diff --git a/daft/filesystem.py b/daft/filesystem.py index 45f36c21e8..86849b66c5 100644 --- a/daft/filesystem.py +++ b/daft/filesystem.py @@ -102,9 +102,10 @@ def get_filesystem(protocol: str, **kwargs) -> fsspec.AbstractFileSystem: def get_protocol_from_path(path: str) -> str: parsed_scheme = urllib.parse.urlparse(path, allow_fragments=False).scheme + parsed_scheme = parsed_scheme.lower() if parsed_scheme == "" or parsed_scheme is None: return "file" - if sys.platform == "win32" and len(parsed_scheme) == 1 and parsed_scheme in string.ascii_letters: + if sys.platform == "win32" and len(parsed_scheme) == 1 and ('a' <= parsed_scheme) and (parsed_scheme <= 'z'): return "file" return parsed_scheme diff --git a/src/daft-io/src/lib.rs b/src/daft-io/src/lib.rs index 45248bc9c1..d630c97d11 100644 --- a/src/daft-io/src/lib.rs +++ b/src/daft-io/src/lib.rs @@ -245,7 +245,7 @@ fn parse_url(input: &str) -> Result<(SourceType, Cow<'_, str>)> { "az" | "abfs" => Ok((SourceType::AzureBlob, fixed_input)), "gcs" | "gs" => Ok((SourceType::GCS, fixed_input)), #[cfg(target_env = "msvc")] - _ if scheme.len() == 1 => k((SourceType::File, Cow::Owned(format!("file://{input}")))), + _ if scheme.len() == 1 && ("a" <= scheme.as_str() && (scheme.as_str() <= "z")) => Ok((SourceType::File, Cow::Owned(format!("file://{input}")))), _ => Err(Error::NotImplementedSource { store: scheme }), } }