-
-
Notifications
You must be signed in to change notification settings - Fork 44
Async Version #51
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
Async Version #51
Conversation
kislyuk
left a comment
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.
This looks pretty good, thanks. What kind of testing have you done? Can you confirm that the tests pass for you with an Aurora cluster?
Thanks for reviewing! |
|
Thank you for your contribution, I will test and release shortly. |
This pull request follows #51 to introduce several improvements and updates to the `aurora_data_api` library by: ### Feature Enhancements: * Changed the `connect` function in async version to `async` function. Although PEP 249 does not define async specifications, it seems to be common that the function is async, including sqlalchemy's expectation ([link](https://github.com/sqlalchemy/sqlalchemy/blob/main/lib/sqlalchemy/ext/asyncio/engine.py#L207)) * Reintroduced and implemented the `TimeFromTicks` function in `aurora_data_api/base.py` to convert ticks into a `datetime.time` object. * Added imports for exception classes in `aurora_data_api/__init__.py`, making them directly accessible from the top-level module. ### Code Cleanup and Consistency: * Reorganized imports across files (`aurora_data_api/async_.py`, `aurora_data_api/sync.py`, `aurora_data_api/base.py`) to improve readability and removed unused imports. Added `# noqa` comments for selective imports to suppress linter warnings. This is required to expose certain elements as per PEP 249. [[1]](diffhunk://#diff-cfa8ccd793ae4442598cce8935ecde0a8dcb5e0b4818a6ae358ebd4120416768L4-R38) [[2]](diffhunk://#diff-bd02193473dcd006fd8f5a83881b0490fe387259fdf6fe2df2dabfa509b7a2a0L4-R39) [[3]](diffhunk://#diff-47197841e264cbaec56838025b342376104f7bb383617f816333b01904fdec68L4-L23) * Standardized string quoting style (single to double quotes) in `aurora_data_api/async_.py` for consistency. ### Test Infrastructure: * Introduced a new `test/base.py` file containing base test classes and a PEP 249 conformance test mixin for validating compliance with the Python DB-API 2.0 specification. * Updated `test/test_async.py` to import and utilize the new base test classes and conformance tests. ### Minor Adjustments (`ruff format` & `ruff check --fix`): * Simplified the `extras_require` dictionary in `setup.py` by formatting it as a single line. * Adjusted line breaks in logging statements and comments for better readability in `aurora_data_api/async_.py`.
This pull request introduces asynchronous support for the
aurora-data-apilibrary, enabling developers to perform non-blocking database operations. Key changes include the addition of an asynchronous client and cursor implementation, updated documentation, and minor refactoring of error handling imports.This fixes #50
Asynchronous Support
AsyncAuroraDataAPIClientandAsyncAuroraDataAPICursorclasses inaurora_data_api/async_.pyto provide asynchronous database interaction usingaiobotocore. These include methods for executing queries, managing transactions, and handling paginated results.connectfunction inaurora_data_api/async_.pyto create instances of the async client.Documentation Updates
README.rstto include installation instructions for async support (pip install aurora-data-api[async]).Codebase Refactoring
aurora_data_api/exceptions.pyto align with updated module names (error_codes_mysqlanderror_codes_postgresql).