Commit ba895d7
authored
feat: ADK Enhancements & Explain Plain support (#299)
* feat: Enhance ADK migration to include memory tables and improve signing tests
- Updated ADK migration script to create memory tables if enabled in the config.
- Added functions to dynamically retrieve memory store classes and check if memory migration is enabled.
- Enhanced the `up` and `down` migration methods to handle memory tables.
- Introduced comprehensive integration tests for storage backend URL signing with real cloud services (MinIO).
- Added unit tests for storage backend URL signing API, covering various edge cases and unsupported protocols.
- Improved protocols for cursor and connection operations, ensuring proper async support.
* chore(refactor): configuration handling and type guards across modules
- Removed unnecessary checks for `extension_config` in ADK migration.
- Simplified configuration retrieval in ADK store classes.
- Enhanced observability span management by directly accessing attributes.
- Introduced new type guards for various protocols to improve type safety.
- Updated logging to utilize structured logging with type casting.
- Improved error handling in storage operations by refining error checks.
- Added support for async operations in storage pipeline with type guards.
- Cleaned up migration command configurations to ensure type consistency.
- Enhanced tests for storage signing protocols with type casting for clarity.
* feat: Introduce _ADKMemoryStoreConfig for improved memory store configuration handling
* feat(protocols): add new protocols for enhanced functionality
- Introduced several new protocols including HasAddListenerProtocol, HasArrowStoreProtocol, HasErrorsProtocol, HasNameProtocol, HasNotifiesProtocol, HasRowcountProtocol, HasSqlStateProtocol, HasSqliteErrorProtocol, HasValueProtocol, and HasTypeCodeProtocol.
- Updated existing protocols to improve type safety and functionality.
- Enhanced ReadableProtocol to accept an optional size parameter for the read method.
refactor(storage): simplify row count handling in SyncStoragePipeline
- Removed unnecessary checks for has_arrow_table_stats when determining row counts in SyncStoragePipeline methods.
- Streamlined the logic for processing rows in both synchronous and asynchronous storage pipelines.
fix(module_loader): improve import_string error handling
- Refined the import_string function to handle attribute access more gracefully, reducing the likelihood of unhandled exceptions.
refactor(schema): optimize type checking and field access
- Improved type guards for dataclass and attrs instances, enhancing performance and readability.
- Simplified field access logic in extract_dataclass_fields and related functions.
test(adk): add integration tests for AioSQLite and SQLite memory stores
- Implemented comprehensive tests for memory store operations including insert, search, delete by session, and delete older than.
- Ensured that memory records are correctly handled and deduplicated.
test(unit): add unit tests for ADK memory converters
- Created tests for event and session conversion functions to validate correct behavior and output.
chore(tests): remove redundant has_attr tests
- Eliminated outdated tests for has_attr function, focusing on more relevant type guard tests.
* chore: remove `hasattr` usages
* fix: test corrections
* refactor(tests): remove xfail markers for DuckDB and PostgreSQL edge cases
* fix: remove type ignore comments for fetchall calls in memory store
* refactor: clean up code and improve type hints across multiple files
* refactor: clean up imports and add type hints in various modules
* refactor: remove unused __slots__ definition from BaseTypeConverter
* refactor: improve type guard checks and enhance memory efficiency tests
* refactor: enhance error handling in statement execution and improve type hints across driver implementations
* chore: compilation progress
* fix: consolidation
* refactor: enhance adapter modules and implement pipeline driver protocols for Oracle and Psycopg
* feat: cleanup type handling
- Renamed and reorganized type handling modules for clarity and consistency.
- Updated imports in Spanner, SQLite, and AsyncPG adapters to use the new _type_converter module.
- Removed deprecated SpannerTypeConverter and replaced it with SpannerOutputConverter.
- Introduced new type conversion logic in SQLite for JSON handling.
- Updated tests to reflect changes in type converter usage across various adapters.
- Ensured that UUID and JSON conversions are handled correctly in Spanner and DuckDB.
- Added recursive conversion for NumPy arrays in schema utilities.
* feat: cleanup
- Moved JSON adapter and converter functions to a new module `type_converter.py` for better organization.
- Updated import paths in SQLite adapter and core modules to reflect the new structure.
- Removed the old `_type_converter.py` file and consolidated its functionality into `type_converter.py`.
- Adjusted unit tests across various adapters to use the new import paths for type converters.
- Ensured compatibility with existing functionality while improving code maintainability.
* refactor: streamline type imports and annotations in type_converter.py
* Refactor type imports across adapters to use _typing module
- Updated imports in ADBC, Aiosqlite, Asyncmy, Asyncpg, BigQuery, DuckDB, Oracledb, Psqlpy, Psycopg, and SQLite adapters to reference the new _typing module instead of _types.
- Introduced _typing.py files in each adapter to define type aliases for connection types, improving type hinting and compatibility with type checkers.
- Removed the deprecated core type conversion module.
- Adjusted the CommonDriverAttributesMixin to allow optional statement configuration.
- Added a new Spanner adapter with appropriate type definitions and configurations.
- Updated unit tests to reflect changes in type imports for Oracledb adapter.
* feat: enhance SQLite connection pool configuration by adding optimizations and health check parameters
* feat: enhance test configurations and skip logic for mypyc-compiled modules
* Refactor code structure for improved readability and maintainability
* Refactor arrow_helpers to support RecordBatchReader return format
- Updated `convert_dict_to_arrow` function to handle "reader" return format, returning an ArrowRecordBatchReader.
- Adjusted overloads for better type hinting and clarity.
- Enhanced handling of empty input cases.
Mock objects are callable by default, causing the config resolver to
invoke them as functions. This returned a new Mock without the
configured attributes. Using NonCallableMock ensures the mock passes
the `not callable()` check and goes through direct validation.
Also converted tests from class-based to function-based per project
guidelines in CLAUDE.md.
* style: apply ruff formatting to test_config_resolver1 parent 2eb97cd commit ba895d7
File tree
333 files changed
+17870
-6498
lines changed- docs
- examples
- extensions/adk
- extensions
- adk
- litestar
- guides
- adapters
- architecture
- development
- events
- extensions
- performance
- quick-reference
- migration-guides
- reference
- sqlspec
- adapters
- adbc
- adk
- litestar
- aiosqlite
- adk
- asyncmy
- adk
- asyncpg
- adk
- events
- bigquery
- adk
- duckdb
- adk
- oracledb
- adk
- events
- litestar
- psqlpy
- adk
- events
- psycopg
- adk
- events
- spanner
- adk
- dialect
- events
- litestar
- sqlite
- adk
- builder
- core
- parameters
- driver
- mixins
- extensions
- adk
- memory
- migrations
- aiosql
- events
- flask
- litestar
- prometheus
- starlette
- migrations
- observability
- storage
- backends
- utils
- tests
- integration
- test_adapters
- test_adbc
- test_extensions/test_adk
- test_aiosqlite
- test_extensions/test_adk
- test_asyncmy
- test_asyncpg
- test_bigquery
- test_duckdb
- test_extensions/test_adk
- test_oracledb
- test_psqlpy
- test_psycopg
- test_spanner
- test_sqlite
- test_extensions/test_adk
- test_config
- test_extensions
- test_events
- test_litestar
- test_storage
- unit
- test_adapters
- test_asyncpg
- test_bigquery
- test_duckdb
- test_oracledb
- test_psycopg
- test_spanner
- test_sqlite
- test_base
- test_builder
- test_config
- test_core
- test_driver
- test_extensions
- test_adk
- test_events
- test_fastapi
- test_loader
- test_migrations
- test_storage
- test_utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
333 files changed
+17870
-6498
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
158 | 167 | | |
159 | 168 | | |
160 | 169 | | |
| |||
340 | 349 | | |
341 | 350 | | |
342 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
343 | 355 | | |
344 | 356 | | |
345 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
13 | 28 | | |
14 | 29 | | |
15 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| 22 | + | |
19 | 23 | | |
| 24 | + | |
20 | 25 | | |
| 26 | + | |
21 | 27 | | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
33 | 48 | | |
34 | 49 | | |
35 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
| |||
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
61 | 107 | | |
62 | 108 | | |
63 | 109 | | |
| |||
170 | 216 | | |
171 | 217 | | |
172 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
173 | 248 | | |
174 | 249 | | |
175 | 250 | | |
| |||
218 | 293 | | |
219 | 294 | | |
220 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
221 | 303 | | |
222 | 304 | | |
223 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 153 | + | |
| 154 | + | |
161 | 155 | | |
162 | 156 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
169 | | - | |
170 | | - | |
| 175 | + | |
| 176 | + | |
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
| |||
178 | 184 | | |
179 | 185 | | |
180 | 186 | | |
| 187 | + | |
181 | 188 | | |
182 | 189 | | |
183 | 190 | | |
| |||
0 commit comments