🧹 Refactor compose_s3_key to use IdentityKey - #46
Conversation
This change resolves a "too many parameters" code health issue by grouping related dataset metadata attributes (dataset, group, year, month, state) into an existing `IdentityKey` dataclass, simplifying the signature of `compose_s3_key`. Also updated all call sites in normalization logic, synchronization loops, and tests to properly construct `IdentityKey`.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🎯 What:
Refactored
compose_s3_keyinpysus/management/records.pyfrom 7 loose parameters down to 3, wrapping dataset identity parameters inside theIdentityKeydataclass.💡 Why:
This improves maintainability and readability by using a parameter object (IdentityKey) that already correctly models a file's logical identity in the domain.
✅ Verification:
poetry run pytest(all 1535 tests pass).pre-commit run --all-fileswhich successfully applied formatting (black/isort) and checked for issues. Fixed missing import statements during code review.pysus/tests/management/test_records.py).✨ Result:
Cleaner code for building dataset S3 keys, with reduced likelihood of passing positional metadata arguments in the wrong order.
PR created automatically by Jules for task 15236124558027080453 started by @devdudumuniz