fix: replace wildcard import from db_calls_card_creation (#13) #34

Merged
cal merged 1 commits from ai/paper-dynasty-card-creation-13 into main 2026-03-23 12:37:31 +00:00
Collaborator

Closes #13

Summary

Replaces from db_calls_card_creation import * in creation_helpers.py with an explicit from 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 only PitcherData is actually referenced in the file.

Files Changed

  • creation_helpers.py — line 13: wildcard → explicit named import

Notes

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.

Closes #13 ## Summary Replaces `from db_calls_card_creation import *` in `creation_helpers.py` with an explicit `from 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 only `PitcherData` is actually referenced in the file. ## Files Changed - `creation_helpers.py` — line 13: wildcard → explicit named import ## Notes 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.
Claude added 1 commit 2026-03-20 23:32:46 +00:00
Closes #13

Replace `from db_calls_card_creation import *` with an explicit
`from db_calls_card_creation import PitcherData`. Only PitcherData
is referenced in creation_helpers.py; the wildcard was also
pulling in all Peewee ORM internals via a transitive
`from peewee import *`, polluting the namespace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude added the
ai-reviewing
label 2026-03-20 23:45:47 +00:00
Claude removed the
ai-reviewing
label 2026-03-20 23:47:55 +00:00
Claude added the
ai-reviewing
label 2026-03-21 00:15:49 +00:00
Claude reviewed 2026-03-21 00:17:21 +00:00
Claude left a comment
Author
Collaborator

AI Code Review

Files Reviewed

  • creation_helpers.py (modified)

Findings

Correctness

  • The import change is correct. PitcherData is defined in db_calls_card_creation.py (line 146) and is the only name from that module referenced in creation_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.
  • The f-string quote normalization (single → double) is purely cosmetic, forced by the ruff pre-commit hook, and introduces no behavior change.

Security

  • No issues. Replacing a wildcard import with an explicit named import reduces unintended namespace pollution — a minor security/hygiene improvement.

Style & Conventions

  • No issues. Explicit imports are standard Python best practice and align with the project's conventions. Quote normalization is consistent throughout the diff.

Suggestions

  • None. The change is minimal and correct.

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 import change is correct. `PitcherData` is defined in `db_calls_card_creation.py` (line 146) and is the only name from that module referenced in `creation_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. - The f-string quote normalization (single → double) is purely cosmetic, forced by the ruff pre-commit hook, and introduces no behavior change. #### Security - No issues. Replacing a wildcard import with an explicit named import reduces unintended namespace pollution — a minor security/hygiene improvement. #### Style & Conventions - No issues. Explicit imports are standard Python best practice and align with the project's conventions. Quote normalization is consistent throughout the diff. #### Suggestions - None. The change is minimal and correct. ### 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*
Claude added
ai-reviewed
and removed
ai-reviewing
labels 2026-03-21 00:17:31 +00:00
cal approved these changes 2026-03-23 12:07:53 +00:00
Dismissed
cal left a comment
Owner

AI Code Review

Files Reviewed

  • creation_helpers.py (modified)

Findings

Correctness

The grep confirms PitcherData is the only symbol from db_calls_card_creation referenced in creation_helpers.py (lines 851–852: PitcherData.get_or_none(...)). The replacement is complete and accurate. No other classes from db_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 transitive from 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 PitcherData was 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

## AI Code Review ### Files Reviewed - `creation_helpers.py` (modified) ### Findings #### Correctness The grep confirms `PitcherData` is the only symbol from `db_calls_card_creation` referenced in `creation_helpers.py` (lines 851–852: `PitcherData.get_or_none(...)`). The replacement is complete and accurate. No other classes from `db_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 transitive `from 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 `PitcherData` was 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*
cal approved these changes 2026-03-23 12:35:57 +00:00
cal left a comment
Owner

Approved. Replacing wildcard imports with explicit imports is the correct fix — improves readability and prevents accidental namespace pollution.

Approved. Replacing wildcard imports with explicit imports is the correct fix — improves readability and prevents accidental namespace pollution.
cal force-pushed ai/paper-dynasty-card-creation-13 from 1e77a24f7f to df6e96bc76 2026-03-23 12:37:25 +00:00 Compare
cal merged commit fd142c27d2 into main 2026-03-23 12:37:31 +00:00
cal deleted branch ai/paper-dynasty-card-creation-13 2026-03-23 12:37:31 +00:00
Sign in to join this conversation.
No reviewers
cal
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-card-creation#34
No description provided.