Repository navigation
Break result sets after failed or cancelled fetches and drop the cross-thread guards #1238
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
7 commits
Select commit
Hold shift + click to select a range
0ebbd4a
Break result sets after a failed fetch and drop the cross-thread guards
laughingman7743 7ba9fbf
Remove the stop_when condition of retry_api_call()
laughingman7743 6b9c77a
Close the result set of a cancelled fetch without the event loop
laughingman7743 f5b27b2
Simplify the failed-fetch and cancelled-close code
laughingman7743 416ab98
Describe how the asyncio cursors run fetches in threads
laughingman7743 1822a28
Break the pandas and Polars result sets on an interrupt while counting
laughingman7743 4677cc7
Expect ProgrammingError after a failed binary CSV chunk read
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
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 (claims, compatibility, operations)
59169c5e137a0b453e8bd441ddbdd4b028df4f94; head:a2d2fc005789ff771f0e84a4e0154dd45a861520.threadsafety = 2(pyathena/__init__.py:30). PEP 249 level 2 lets threads share connections, not cursors.operator.index(size)runs before the check, in sync and aio.AsyncCursor.cancel(query_id)exists (pyathena/async_cursor.py:304).stop_when(Defer closing a chunk reader while another thread reads it #1182, Take buffered rows in bulk in fetchmany() and fetchall() #1187, Give the chunk readers the state that close() clears when they are created #1190, Discard the page of a request that close() interrupts #1197, Stop the retries of closed result sets and cancelled asyncio calls #1223) are in no tag, andgit show v4.1.0:pyathena/util.pyhas nostop_when. The public signatures therefore match v4.1.0.docs/pandas.md,docs/polars.md,docs/arrow.md, anddocs/s3fs.mdsaid the asyncio cursors useasyncio.to_thread()for creation and fetches. That was already inaccurate for creation (create_in_thread) and is now inaccurate for fetches.docs/aio.mdnow says what a cancellation does to a fetch that has not started.stop_whenremoval, the partial Give the chunk readers the state that close() clears when they are created #1190 revert, the cross-threadcancel()release note, and dropping the earlier draft release-note entries.close()from another thread no longer stopsGetQueryResultsretries. That use is unsupported.ef1b3a09(code);a2d2fc00changes only docs:tests/pyathena/aio/{pandas,polars,arrow,s3fs}/test_cursor.py,tests/pyathena/aio/test_cursor.py): 139 passed.just lintpassed. markdownlint: 0 errors.just docs buildsucceeded.docs/spark.md:280still showsthreading.Timer(60, cursor.cancel)on the same cursor. Spark has no start callback, so this waits for the maintainer's decision.