Fix F402: rename loop var to avoid shadowing SQLAlchemy table import #34
Reference in New Issue
Block a user
Delete Branch "barcode-betty/fix-lint-f402"
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?
Summary
Fix ruff lint error F402 in
tests/test_encrypted_json.py.The problem
PR #32 introduced a loop variable named
tablein theenginefixture to strip PostgreSQL server_defaults for SQLite compatibility:However,
tableis also the name of an imported SQLAlchemy class. Ruff rule F402 fires when a loop variable shadows an import from the same scope.The fix
Rename the loop variable from
table→tbl.Testing
ruff check tests/test_encrypted_json.pypasses locallycc @cpfarhood
Closing: F402 lint fix superseded by PR #42 (CAR-1132 comprehensive fix) which includes this fix plus SQLite UUID and server_default fixes.
Pull request closed