diff --git a/pyiceberg/io/pyarrow.py b/pyiceberg/io/pyarrow.py index 8f22261f5d..5e9a350d46 100644 --- a/pyiceberg/io/pyarrow.py +++ b/pyiceberg/io/pyarrow.py @@ -397,7 +397,8 @@ def parse_location(location: str, properties: Properties = EMPTY_DICT) -> tuple[ """ uri = urlparse(location) - if not uri.scheme: + if not uri.scheme or (len(uri.scheme) == 1 and uri.scheme.isalpha()): + # len == 1 and alpha catches Windows drive letters like C:\ D:\ default_scheme = properties.get("DEFAULT_SCHEME", "file") default_netloc = properties.get("DEFAULT_NETLOC", "") return default_scheme, default_netloc, os.path.abspath(location) @@ -406,6 +407,7 @@ def parse_location(location: str, properties: Properties = EMPTY_DICT) -> tuple[ else: return uri.scheme, uri.netloc, f"{uri.netloc}{uri.path}" + def _initialize_fs(self, scheme: str, netloc: str | None = None) -> FileSystem: """Initialize FileSystem for different scheme.""" if scheme in {"oss"}: