-
Notifications
You must be signed in to change notification settings - Fork 78
feat: add SQLiteLookup for lookup joins with SQLite database #900
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
Conversation
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.
Pull Request Overview
Adds a new SQLiteLookup
implementation to enable lookup joins against a SQLite database, complete with caching, custom query support, and identifier validation.
- Introduces
SQLiteLookup
,SQLiteLookupField
, andSQLiteLookupQueryField
insqlite.py
- Provides a comprehensive test suite in
tests/test_quixstreams/test_dataframe/test_lookup_sqlite.py
- Updates type hints for lookup joins to use
Mapping[str, F]
and exposes new lookup classes in__init__.py
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tests/test_quixstreams/test_dataframe/test_lookup_sqlite.py | Adds end-to-end tests covering basic lookups, TTL, ordering, defaults, errors, and query fields |
quixstreams/dataframe/joins/lookups/sqlite.py | Implements SQLite-backed lookup join, field definitions, caching, and result extraction |
quixstreams/dataframe/joins/lookups/quix_configuration_service/lookup.py | Updates type hint for fields parameter to Mapping[str, Field] |
quixstreams/dataframe/joins/lookups/base.py | Updates abstract join signature to accept Mapping[str, F] |
quixstreams/dataframe/joins/lookups/init.py | Exposes the new SQLite lookup classes in the package API |
Comments suppressed due to low confidence (2)
quixstreams/dataframe/joins/lookups/sqlite.py:48
- There's no test covering the first_match_only=False path for SQLiteLookupField, which should return multiple rows; consider adding a test to verify that behavior.
class SQLiteLookupField(BaseSQLiteLookupField):
quixstreams/dataframe/joins/lookups/sqlite.py:96
- [nitpick] The parameter name 'on' is ambiguous and could be misread; consider renaming it to something more descriptive like 'key_column' or 'lookup_column'.
on: str
- Introduce SQLiteLookup, SQLiteLookupField, and SQLiteLookupQueryField for enriching streaming data using SQLite. - Support safe table/column name validation and parameterized queries to prevent SQL injection. - Implement per-field caching with configurable TTL. - Add support for both simple and advanced SQL queries in lookup joins. - Update __init__.py to export new SQLite lookup classes.
SQLite only returns basic data type. We don't need to deepcopy them Co-authored-by: Copilot <[email protected]>
This creates problem when a parent dataclass has parameters with default values and a child dataclass wants attributes without default.
… first_match_only=False
280e51f
to
df059ce
Compare
No description provided.