Skip to content

Commit 57518ef

Browse files
author
Tom McCormick
committed
address comments
1 parent 61980c3 commit 57518ef

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pyiceberg/io/pyarrow.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,18 +390,17 @@ def __init__(self, properties: Properties = EMPTY_DICT):
390390
def parse_location(location: str, properties: Properties = EMPTY_DICT) -> Tuple[str, str, str]:
391391
"""Return (scheme, netloc, path) for the given location.
392392
393-
Uses environment variables DEFAULT_SCHEME and DEFAULT_NETLOC
394-
if scheme/netloc are missing.
393+
Uses DEFAULT_SCHEME and DEFAULT_NETLOC if scheme/netloc are missing.
395394
"""
396395
uri = urlparse(location)
397396

398-
# Load defaults from environment
399397
default_scheme = properties.get("DEFAULT_SCHEME", "file")
400398
default_netloc = properties.get("DEFAULT_NETLOC", "")
401399

402-
# Apply logic
403-
scheme = uri.scheme or default_scheme
404-
netloc = uri.netloc or default_netloc
400+
if not uri.scheme:
401+
scheme = default_scheme
402+
if not uri.netloc:
403+
netloc = default_netloc
405404

406405
if scheme in ("hdfs", "viewfs"):
407406
return scheme, netloc, uri.path

0 commit comments

Comments
 (0)