Skip to content

Commit 9387d6e

Browse files
author
Tom McCormick
committed
pr comments
1 parent 1a75ab6 commit 9387d6e

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

tests/io/test_pyarrow.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2785,33 +2785,26 @@ def _expected_batch(unit: str) -> pa.RecordBatch:
27852785

27862786
assert _expected_batch("ns" if format_version > 2 else "us").equals(actual_result)
27872787

2788-
def test_parse_location_environment_defaults():
2789-
2790-
"""Test that parse_location uses environment variables for defaults."""
2788+
def test_parse_location_defaults() -> None:
2789+
"""Test that parse_location uses defaults."""
27912790

27922791
from pyiceberg.io.pyarrow import PyArrowFileIO
27932792

2794-
# Test with default environment (no env vars set)
27952793
scheme, netloc, path = PyArrowFileIO.parse_location("/foo/bar")
27962794
assert scheme == "file"
27972795
assert netloc == ""
27982796
assert path == "/foo/bar"
27992797

2800-
# Test with properties set
2801-
properties = {}
2802-
properties["DEFAULT_SCHEME"] = "scheme"
2803-
properties["DEFAULT_NETLOC"] = "netloc:8000"
2804-
2805-
scheme, netloc, path = PyArrowFileIO.parse_location("/foo/bar", properties=properties)
2798+
scheme, netloc, path = PyArrowFileIO.parse_location(
2799+
"/foo/bar", properties={"DEFAULT_SCHEME": "scheme", "DEFAULT_NETLOC": "netloc:8000"}
2800+
)
28062801
assert scheme == "scheme"
28072802
assert netloc == "netloc:8000"
28082803
assert path == "netloc:8000/foo/bar"
28092804

2810-
# Set properties
2811-
properties["DEFAULT_SCHEME"] = "hdfs"
2812-
properties["DEFAULT_NETLOC"] = "netloc:8000"
2813-
2814-
scheme, netloc, path = PyArrowFileIO.parse_location("/foo/bar", properties=properties)
2805+
scheme, netloc, path = PyArrowFileIO.parse_location(
2806+
"/foo/bar", properties={"DEFAULT_SCHEME": "hdfs", "DEFAULT_NETLOC": "netloc:8000"}
2807+
)
28152808
assert scheme == "hdfs"
28162809
assert netloc == "netloc:8000"
28172810
assert path == "/foo/bar"

0 commit comments

Comments
 (0)