cbb330 commented on code in PR #2291:
URL: https://github.com/apache/iceberg-python/pull/2291#discussion_r2257884044
##########
pyiceberg/io/pyarrow.py:
##########
@@ -388,14 +388,29 @@ def __init__(self, properties: Properties = EMPTY_DICT):
@staticmethod
def parse_location(location: str) -> Tuple[str, str, str]:
- """Return the path without the scheme."""
+ """Return (scheme, netloc, path) for the given location.
+
+ Uses environment variables DEFAULT_SCHEME and DEFAULT_NETLOC
+ if scheme/netloc are missing.
+ """
uri = urlparse(location)
- if not uri.scheme:
- return "file", uri.netloc, os.path.abspath(location)
- elif uri.scheme in ("hdfs", "viewfs"):
- return uri.scheme, uri.netloc, uri.path
+
+ # Load defaults from environment
+ default_scheme = os.getenv("DEFAULT_SCHEME", "file")
Review Comment:
can we use central config instead of direct usage of env variables?
`pyiceberg/utils/config.py `
this would enable configuration via file OR env variables, which is how most
other configs are documented and exposed to catalog construction.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]