-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Labels
Description
Summary
Multiple cursor classes (sync/async + pandas/arrow/polars/s3fs) duplicate the same execute() argument handling for parameters like result_set_type_hints, result_reuse_enable, paramstyle, etc. Each new parameter added to execute() requires updating 11+ cursor files.
Proposal
Extract shared execute() kwargs into an ExecuteOptions dataclass or mixin to:
- Reduce duplication across cursor implementations
- Make it easier to add new
execute()parameters in the future - Centralize parameter validation and documentation
Affected files
pyathena/cursor.pypyathena/async_cursor.pypyathena/aio/cursor.pypyathena/pandas/cursor.py,pyathena/pandas/async_cursor.pypyathena/arrow/cursor.py,pyathena/arrow/async_cursor.pypyathena/polars/cursor.py,pyathena/polars/async_cursor.pypyathena/s3fs/cursor.py,pyathena/s3fs/async_cursor.py
Definition of Done
- Adding a new
execute()argument requires changes in 1-2 files (not 11+) - sync/async + pandas/arrow/polars/s3fs cursors share the same validation logic (type checks, mutual exclusion, default resolution)
execute()argument documentation lives in a single source (dataclass/mixin docstring) rather than being duplicated per cursor
Context
Identified during PR review of result_set_type_hints feature (#690). Scoped out to keep the initial PR focused on core functionality.
Reactions are currently unavailable