diff --git a/pandas/compat/_optional.py b/pandas/compat/_optional.py index a3c0e6691dd22..f36ff5c2b8abd 100644 --- a/pandas/compat/_optional.py +++ b/pandas/compat/_optional.py @@ -1,7 +1,6 @@ import distutils.version import importlib import types -from typing import Optional import warnings # Update install.rst when updating versions! @@ -53,7 +52,7 @@ def import_optional_dependency( extra: str = "", raise_on_missing: bool = True, on_version: str = "raise", -) -> Optional[types.ModuleType]: +): """ Import an optional dependency. diff --git a/pandas/io/gcs.py b/pandas/io/gcs.py index 310a1f9f398e9..862ccbb291c01 100644 --- a/pandas/io/gcs.py +++ b/pandas/io/gcs.py @@ -15,5 +15,5 @@ def get_filepath_or_buffer(filepath_or_buffer, encoding=None, fs = gcsfs.GCSFileSystem() filepath_or_buffer = fs.open( - filepath_or_buffer, mode) # type: gcsfs.GCSFile + filepath_or_buffer, mode) return filepath_or_buffer, None, compression, True diff --git a/pandas/io/s3.py b/pandas/io/s3.py index 61fd984789f78..d784e8d473aac 100644 --- a/pandas/io/s3.py +++ b/pandas/io/s3.py @@ -34,5 +34,5 @@ def get_filepath_or_buffer(filepath_or_buffer, encoding=None, # for that bucket. fs = s3fs.S3FileSystem(anon=True) filepath_or_buffer = fs.open( - _strip_schema(filepath_or_buffer), mode) # type: s3fs.S3File + _strip_schema(filepath_or_buffer), mode) return filepath_or_buffer, None, compression, True