Add unit tests for Path and UPath handling in _get_storage_options_and_path #387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds comprehensive unit tests for the
_get_storage_options_and_path
function to address code-coverage regressions introduced in a recent branch. The function handles different input types (Path
,UPath
, andstr
) but these code paths were not being exercised by existing tests.Problem
The
_get_storage_options_and_path
function insrc/nested_pandas/nestedframe/io.py
contains branches that test forPath
andUPath
types (lines 218-233), but these branches were not covered by any unit tests, leading to code-coverage regressions.Solution
Added a new test function
test__get_storage_options_and_path()
that comprehensively exercises all input types and scenarios:pathlib.Path
""
or"file"
)FSSPEC_BLOCK_SIZE
optimization)Results
io.py
_get_storage_options_and_path
are now testedTesting
The new test validates that:
None
for storage optionsTypeError
as expectedWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
nasa-irsa-euclid-q1.s3.us-east-1.amazonaws.com
python -m pytest tests/nested_pandas/nestedframe/test_io.py::test__transform_read_parquet_data_arg -v
(dns block)python -m pytest tests/nested_pandas/nestedframe/test_io.py -v --cov=src/nested_pandas/nestedframe/io --cov-report=term-missing --cov-report=html -x
(dns block)python -m pytest tests/nested_pandas/nestedframe/test_io.py --ignore=tests/nested_pandas/nestedframe/test_io.py::test__transform_read_parquet_data_arg --cov=src/nested_pandas/nestedframe/io --cov-report=term-missing
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.