Reduce too-many-instance-attributes across piccolo codebase#1396
Open
waniasantos wants to merge 11 commits into
Open
Reduce too-many-instance-attributes across piccolo codebase#1396waniasantos wants to merge 11 commits into
waniasantos wants to merge 11 commits into
Conversation
…ttributes (R0902)
…tance attributes (R0902)
…igger instance attributes (R0902)
…grationOperations with backward-compatible constructor (R0902)
…nstance attributes (R0902)
…uce instance attributes (R0902)
…s to reduce instance attributes (R0902)
…duce instance attributes (R0902)
…um in SQLiteTransaction (R0902)
…s SQLite and Postgres engines (R0902)
… dataclass (R0902)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors 11 occurrences of Pylint's
too-many-instance-attributes(R0902) by grouping related attributes into semantic sub-dataclasses. Consistent pattern applied across the codebase: attributes moved to auxiliary classes, with properties (getter/setter) preserving full backward compatibility with the existing public API.Refactored classes
TableMeta(table.py)RowMeta(apps/schema/commands/generate.py)Trigger(apps/schema/commands/generate.py)MigrationManager(apps/migrations/auto/migration_manager.py)AlterColumn(apps/migrations/auto/operations.py)Select(query/methods/select.py)Alter(query/methods/alter.py)Objects(query/methods/objects.py)SQLiteTransaction(engine/sqlite.py)PostgresTransaction(engine/postgres.py)ColumnMeta(columns/base.py)Validation
pytest) passes after each refactorNotes
MigrationManagerrequired a custom__init__to preserve compatibility with legacy direct calls (migration_id=...) found in real migration filesTransactionStatewas centralized inbase.py, removing duplication betweenSQLiteTransactionandPostgresTransaction