From d5bc8781d6940c572d21287341992b229f62f994 Mon Sep 17 00:00:00 2001 From: Future-Outlier Date: Sun, 10 Mar 2024 17:13:26 +0800 Subject: [PATCH] Fix sql alchemy plugin error `module 'pandas.io' has no attribute 'common' ` (#2249) Signed-off-by: Future-Outlier --- flytekit/types/structured/basic_dfs.py | 4 +++- plugins/flytekit-sqlalchemy/setup.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/flytekit/types/structured/basic_dfs.py b/flytekit/types/structured/basic_dfs.py index 1c21a6b2d8..f9f5d536a6 100644 --- a/flytekit/types/structured/basic_dfs.py +++ b/flytekit/types/structured/basic_dfs.py @@ -34,7 +34,9 @@ def get_pandas_storage_options( uri: str, data_config: DataConfig, anonymous: bool = False ) -> typing.Optional[typing.Dict]: - if pd.io.common.is_fsspec_url(uri): + from pandas.io.common import is_fsspec_url + + if is_fsspec_url(uri): return get_fsspec_storage_options(protocol=get_protocol(uri), data_config=data_config, anonymous=anonymous) # Pandas does not allow storage_options for non-fsspec paths e.g. local. diff --git a/plugins/flytekit-sqlalchemy/setup.py b/plugins/flytekit-sqlalchemy/setup.py index 4d59e31686..4d5f3d9c6d 100644 --- a/plugins/flytekit-sqlalchemy/setup.py +++ b/plugins/flytekit-sqlalchemy/setup.py @@ -4,7 +4,7 @@ microlib_name = f"flytekitplugins-{PLUGIN_NAME}" -plugin_requires = ["flytekit>=1.3.0b2,<2.0.0", "sqlalchemy>=1.4.7", "pandas"] +plugin_requires = ["flytekit>=1.3.0b2,<2.0.0", "sqlalchemy>=1.4.7", "pandas<=2.1.4"] __version__ = "0.0.0+develop"