Commit 6f81da3
authored
Enhance DB-API 2.0 (PEP 249) Conformance (#52)
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`.1 parent 2d60d0c commit 6f81da3
File tree
9 files changed
+641
-250
lines changed- aurora_data_api
- test
9 files changed
+641
-250
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
13 | 27 | | |
14 | 28 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
27 | 39 | | |
28 | 40 | | |
29 | 41 | | |
| |||
184 | 196 | | |
185 | 197 | | |
186 | 198 | | |
187 | | - | |
| 199 | + | |
188 | 200 | | |
189 | 201 | | |
190 | 202 | | |
191 | 203 | | |
192 | 204 | | |
193 | 205 | | |
194 | | - | |
| 206 | + | |
195 | 207 | | |
196 | 208 | | |
197 | 209 | | |
| |||
203 | 215 | | |
204 | 216 | | |
205 | 217 | | |
206 | | - | |
207 | | - | |
208 | | - | |
| 218 | + | |
209 | 219 | | |
210 | 220 | | |
211 | 221 | | |
212 | 222 | | |
213 | 223 | | |
214 | 224 | | |
215 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
216 | 228 | | |
217 | 229 | | |
218 | 230 | | |
| |||
262 | 274 | | |
263 | 275 | | |
264 | 276 | | |
265 | | - | |
| 277 | + | |
266 | 278 | | |
267 | 279 | | |
268 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 17 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
13 | 28 | | |
14 | 29 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
0 commit comments