fix: replace wildcard import from db_calls_card_creation (#13) #34
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-card-creation#34
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/paper-dynasty-card-creation-13"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #13
Summary
Replaces
from db_calls_card_creation import *increation_helpers.pywith an explicitfrom db_calls_card_creation import PitcherData.The wildcard imported all Peewee ORM model classes plus a transitive
from peewee import *(CharField, FloatField, Model, SqliteDatabase, etc.) into the module namespace. Grep confirmed onlyPitcherDatais actually referenced in the file.Files Changed
creation_helpers.py— line 13: wildcard → explicit named importNotes
The pre-commit hook (ruff formatter) also applied automatic quote-style normalisation to f-strings in the same file (single → double quotes). These cosmetic changes were unavoidable as skipping hooks is not permitted.
AI Code Review
Files Reviewed
creation_helpers.py(modified)Findings
Correctness
PitcherDatais defined indb_calls_card_creation.py(line 146) and is the only name from that module referenced increation_helpers.py(lines 851–852). Grep confirms no other class names (ScoutPlayer,BatterRatings,PitcherRatings,CardColumns,Position,BatterData, etc.) or transitive Peewee names (CharField,FloatField,Model, etc.) appear in this file.Security
Style & Conventions
Suggestions
Verdict: APPROVED ✓
Clean, minimal fix. The wildcard → explicit import is verified by grep, behavior is unchanged, and the cosmetic quote normalization is unavoidable given the no-skip-hooks policy.
Automated review by Claude PR Reviewer
AI Code Review
Files Reviewed
creation_helpers.py(modified)Findings
Correctness
The grep confirms
PitcherDatais the only symbol fromdb_calls_card_creationreferenced increation_helpers.py(lines 851–852:PitcherData.get_or_none(...)). The replacement is complete and accurate. No other classes fromdb_calls_card_creation(ScoutCardset,ScoutPlayer,BatterRatings,PitcherRatings,BatterData,Position,CardColumns,CardOutput) are used anywhere in this file.Security
No issues. The change removes a wildcard import that previously polluted the module namespace with all Peewee ORM primitives (
CharField,FloatField,Model,SqliteDatabase, etc.) via a transitivefrom peewee import *. The explicit import is strictly better from a security and maintainability standpoint.Style & Conventions
The ruff formatter changes (single → double quote normalisation in f-strings) are cosmetic and consistent with the project's pre-commit hook enforcement. They are not a concern.
Suggestions
None.
Verdict: APPROVED
The change does exactly what the PR description states. Only
PitcherDatawas ever used from the wildcard import. The namespace pollution is fully resolved, ruff reformatting is expected and unavoidable per project policy, and there are no logic, security, or correctness issues introduced.Automated review by Claude PR Reviewer
Approved. Replacing wildcard imports with explicit imports is the correct fix — improves readability and prevents accidental namespace pollution.
1e77a24f7ftodf6e96bc76