File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -394,6 +394,7 @@ def __init__(self, properties: Properties = EMPTY_DICT):
394394 @staticmethod
395395 def parse_location (location : str ) -> Tuple [str , str , str ]:
396396 """Return (scheme, netloc, path) for the given location.
397+
397398 Uses environment variables DEFAULT_SCHEME and DEFAULT_NETLOC
398399 if scheme/netloc are missing.
399400 """
Original file line number Diff line number Diff line change @@ -2786,21 +2786,23 @@ def _expected_batch(unit: str) -> pa.RecordBatch:
27862786 assert _expected_batch ("ns" if format_version > 2 else "us" ).equals (actual_result )
27872787
27882788def test_parse_location_environment_defaults ():
2789+
27892790 """Test that parse_location uses environment variables for defaults."""
2790- from pyiceberg .io .pyarrow import PyArrowFileIO
27912791 import os
2792-
2792+
2793+ from pyiceberg .io .pyarrow import PyArrowFileIO
2794+
27932795 # Test with default environment (no env vars set)
27942796 scheme , netloc , path = PyArrowFileIO .parse_location ("/foo/bar" )
27952797 assert scheme == "file"
27962798 assert netloc == ""
27972799 assert path == "/foo/bar"
2798-
2800+
27992801 try :
28002802 # Test with environment variables set
28012803 os .environ ["DEFAULT_SCHEME" ] = "scheme"
28022804 os .environ ["DEFAULT_NETLOC" ] = "netloc:8000"
2803-
2805+
28042806 scheme , netloc , path = PyArrowFileIO .parse_location ("/foo/bar" )
28052807 assert scheme == "scheme"
28062808 assert netloc == "netloc:8000"
You can’t perform that action at this time.
0 commit comments