Repository navigation
Rename the opt-in S3FS CSV reader and define its protocol #1107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
146455f
Rename the opt-in S3FS CSV reader and define its protocol
laughingman7743 774219e
Pass reader options through integration cursor fixtures
laughingman7743 010be3f
Group S3FS result-set tests by object behavior
laughingman7743 f41b8a0
Read empty fields as None in EmptyStringAsNullCSVReader
laughingman7743 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review round two — CLEAN (compatibility, claims, and operational review).
Frozen range:
971dd12dd1a638429a5691d3be0e300555edb15e..146455fe6c59b4e0b87153b426b527d3afd10fd4. Initial pass covered all 13 changed files and the PR description, with a separate audit of defaults, caller compatibility, public typing, migration examples, NULL handling guarantees, and validation claims.Confirmed that the old public name is removed for 4.0 and appears only in migration prose; AthenaCSVReader remains the default; direct reader iteration retains its existing values; the instance flag governs CSV/TSV results across all three cursor families, including the type-hint branch. Managed/API fallback retains its existing values and is explicitly excluded from the flag's documented scope. Positive and expected-negative mypy probes support the structural typing claim; documentation lint, full multiversion build, direct current-tree build, and rendered migration/API checks passed. Source inspection does not establish AWS execution.
No additional Athena/S3 requests, retry changes, dependency changes, or unrelated dialect changes are introduced. Existing Sphinx warnings are outside this patch. Shared AWS validation is serialized with other runs; live coverage remains pending. No actionable defects found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Round-two repair follow-up — CLEAN for the corrected scope.
Frozen range:
971dd12dd1a638429a5691d3be0e300555edb15e..774219e113d55e6bc4e54c290e7351e7dcfac433; reviewed the bounded patch-series comparison from146455fe6c59b4e0b87153b426b527d3afd10fd4and traced both corrected fixture mappings to their existing connection/cursor contracts. The updated migration note explicitly states that custom readers need empty_strings_as_null, with False preserving empty strings and True normalizing them before result-file type conversion. The new wording rendered successfully and matches the Protocol and actual converter path. Direct iteration and API fallback remain distinct in the docs.Clarification to the initial operational record: library execution adds no Athena/S3 requests; the integration coverage adds six query cases across the two async cursor families. No retry, dependency, or dialect change is introduced. Repaired test expectations remain based on literal observable values. Static/source checks and mocked forwarding do not establish live AWS results. No further actionable defects found within the repaired scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Round-two test-organization follow-up — CLEAN.
Frozen full range: 971dd12..010be3f; previously reviewed head: 774219e. Audited the claim that grouping tests preserves coverage and runtime semantics separately from the implementation pass.
The 22 result-set parameter cases, explicit expected values, context-manager cleanup and reader selection are unchanged; the combined reader/result-set run collected and passed 57 cases. The new class matches AGENTS.md's rule permitting unit tests to group one object's behavior. Pytest creates separate test instances; no class-scoped fixtures or mutable self state were added. Searching the repository found no references to the former standalone test node names; only the class prefix changes. Live session setup/teardown from tests/pyathena/conftest.py ran under the standard pytest command; the tested reader/result-set operations themselves use in-memory streams and mocked AWS calls. The prior broad AWS CI result remains evidence for 774219e; current-head CI will be required before Ready. No new API, naming, documentation or performance claims were introduced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review round two for the reader-side conversion repair: CLEAN (compatibility, claims, operations).
Range:
971dd12dd1a638429a5691d3be0e300555edb15e..f41b8a07bd860ec94496f0c4c2eaafdf047c193e.Compatibility: cursor results are unchanged from 3.x for both readers. The only behavior change beyond the rename is direct iteration of
EmptyStringAsNullCSVReader, which now yields None instead of''; the 4.0 note indocs/s3fs.mdstates it. Custom readers no longer need a new attribute, so the earlier migration requirement is removed from the docs. Release notes for 4.0.0 should list the rename and the direct-iteration change.Claims: removed the doc sentences that described the flag and the result-set conversion, and the claim that direct iteration returns empty strings. The custom-reader section now states that the cursor treats None as NULL and that managed query results are read through the Athena API, which matches
AthenaS3FSResultSet.__init__.docs/api/s3fs.rststill documents the protocol and both readers.Operational: the change removes one list comprehension per row from the default reader path and moves the same comprehension into the opt-in reader; the integration tests issue two fewer Athena queries. Upstream
masteradvanced tof3532e9fb57fd769441e533f0b8375fd854ece69(#1110); it touches no S3FS, reader, or docs surface in this PR, and GitHub reports the PR mergeable.