Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Newton committed Sep 25, 2023
1 parent 9816450 commit de3a74b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions flytekit/types/structured/basic_dfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
def get_pandas_storage_options(
uri: str, data_config: DataConfig, anonymous: bool = False
) -> typing.Optional[typing.Dict]:
print(f"check is uri, uri = {uri}")
print(get_fsspec_storage_options)
if pd.io.common.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 on-fsspec paths e.g. local.
# Pandas does not allow storage_options for non-fsspec paths e.g. local.
return None


Expand Down
8 changes: 2 additions & 6 deletions tests/flytekit/unit/core/test_structured_dataset_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ def test_csv():
@mock.patch("pandas.DataFrame.to_parquet")
@mock.patch("pandas.read_parquet")
@mock.patch("flytekit.types.structured.basic_dfs.get_fsspec_storage_options")
def test_pandas_to_parquet_azure_storage_options(
mock_get_fsspec_storage_options, mock_read_parquet, mock_to_parquet
):
def test_pandas_to_parquet_azure_storage_options(mock_get_fsspec_storage_options, mock_read_parquet, mock_to_parquet):
df = pd.DataFrame({"Name": ["Tom", "Joseph"], "Age": [20, 22]})
encoder = basic_dfs.PandasToParquetEncodingHandler()
decoder = basic_dfs.ParquetToPandasDecodingHandler()
Expand Down Expand Up @@ -84,9 +82,7 @@ def test_pandas_to_parquet_azure_storage_options(
@mock.patch("pandas.DataFrame.to_csv")
@mock.patch("pandas.read_csv")
@mock.patch("flytekit.types.structured.basic_dfs.get_fsspec_storage_options")
def test_pandas_to_csv_azure_storage_options(
mock_get_fsspec_storage_options, mock_read_parquet, mock_to_parquet
):
def test_pandas_to_csv_azure_storage_options(mock_get_fsspec_storage_options, mock_read_parquet, mock_to_parquet):
df = pd.DataFrame({"Name": ["Tom", "Joseph"], "Age": [20, 22]})
encoder = basic_dfs.PandasToCSVEncodingHandler()
decoder = basic_dfs.CSVToPandasDecodingHandler()
Expand Down

0 comments on commit de3a74b

Please sign in to comment.