forked from datafold/data-diff
-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: decompose base.py (1,315 lines) into compiler/dialect/database modules #50
Copy link
Copy link
Open
Labels
P3-backlogBacklog, do when demand appearsBacklog, do when demand appearstechnical-debtTechnical debt itemsTechnical debt itemstriage
Description
Problem
data_diff/databases/base.py (1,315 lines) bundles four distinct responsibilities:
- Compiler — SQL AST compilation
- BaseDialect — SQL dialect abstraction
- Database — Connection management (cloud/async)
- ThreadedDatabase — Connection pooling (cursor-based)
Every driver author must understand the entire file. This is a barrier to contribution.
Proposed Decomposition
data_diff/databases/
compiler.py # Compiler class
dialect.py # BaseDialect ABC
database.py # Database + ThreadedDatabase ABCs
base.py # Re-exports for backward compatibility (temporary)
Constraints
- All existing imports must continue working
- No behavioral changes
- Driver files should not need modification
Acceptance Criteria
- base.py split into 3-4 focused modules
- All existing tests pass without modification
- Backward-compatible re-exports in base.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3-backlogBacklog, do when demand appearsBacklog, do when demand appearstechnical-debtTechnical debt itemsTechnical debt itemstriage