From 820b022ae7f61a767890946208eab51881e9fbdf Mon Sep 17 00:00:00 2001 From: Alex Toker Date: Thu, 3 Aug 2023 13:46:26 +0300 Subject: [PATCH] Addressing Gal's comments --- integration/test_filesystems_integration.py | 10 +++++++++- storey/utils.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/integration/test_filesystems_integration.py b/integration/test_filesystems_integration.py index 7ce8daa9..5fe8eda8 100644 --- a/integration/test_filesystems_integration.py +++ b/integration/test_filesystems_integration.py @@ -22,6 +22,7 @@ import pandas as pd import pytest import v3io +from fsspec.implementations.local import LocalFileSystem from integration.integration_test_utils import V3ioHeaders, _generate_table_name from storey import ( @@ -38,7 +39,7 @@ build_flow, ) from storey.dtypes import V3ioError -from storey.utils import get_remaining_path +from storey.utils import get_remaining_path, url_to_file_system @pytest.fixture() @@ -672,3 +673,10 @@ def test_get_path_utils(): schema, path = get_remaining_path(url) assert path == "mycontainer/path/to/object.csv" assert schema == "wasbs" + + +def test_ds_get_path_utils(): + url = "ds://:file@profile/path/to/object.csv" + fs, path = url_to_file_system(url, "") + assert path == "/path/to/object.csv" + assert isinstance(fs, LocalFileSystem) diff --git a/storey/utils.py b/storey/utils.py index b06061af..d2731043 100644 --- a/storey/utils.py +++ b/storey/utils.py @@ -143,7 +143,7 @@ def url_to_file_system(url, storage_options): if parsed_url.password: scheme = parsed_url.password else: - raise ValueError("Datastore profile URL expecting to have underlying scheme embedded as a password") + raise ValueError("Datastore profile URL is expected to have underlying scheme embedded as password") if scheme: load_fs_dependencies(scheme)