anxkhn opened a new pull request, #50389:
URL: https://github.com/apache/arrow/pull/50389
### Rationale for this change
In `test_get_file_info_with_selector` (`python/pyarrow/tests/test_fs.py`),
the
recursive-selector count check on the fsspec S3 branch was written as a bare
expression:
```python
if fs.type_name == "py::fsspec+('s3', 's3a')":
# s3fs only lists directories if they are not empty
len(infos) == 4 # evaluated and discarded, never asserted
else:
assert len(infos) == 5
```
Because there is no `assert`, the comparison is evaluated and thrown away,
so the
recursive listing count is never actually verified when the parametrized
filesystem
is s3fs-backed. Every sibling count check in the same test already asserts:
the
non-s3fs recursive branch (`assert len(infos) == 5`) and both non-recursive
branches
(`assert len(infos) == 3` for s3fs, `assert len(infos) == 4` otherwise).
This one
branch is the sole exception.
### What changes are included in this PR?
Add the missing `assert` keyword to that single line so the s3fs recursive
count is
checked like its siblings:
```diff
- len(infos) == 4
+ assert len(infos) == 4
```
One file, one line. No production code and no other test logic is touched.
The
expected value of `4` is unchanged and already correct: the fixture creates
`test_file_a`, `test_file_b`, `test_dir_a`, `test_dir_a/test_file_c`, and an
empty
`test_dir_b`; s3fs does not list empty directories, so the recursive listing
returns
4 entries (the empty `test_dir_b` is omitted). The following loop that
classifies each
returned path (and raises `ValueError` on anything unexpected) is consistent
with
exactly those 4 paths.
### Are these changes tested?
This is a change to an existing test. The line now participates in
assertions instead
of being a no-op. The s3fs branch runs under the fsspec-S3 parametrization
of the
filesystem fixture, which is exercised by the Python CI jobs; behaviour on
all other
(non-s3fs) filesystems is unchanged. flake8 (the repo's configured Python
lint,
`python/setup.cfg`) passes on the changed file.
### Are there any user-facing changes?
No. This is a test-only change with no impact on any public API or library
behaviour.
--
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]