Replies: 1 comment 2 replies
-
|
I can't argue with any of that - thanks! Nice refactoring here. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I just did a small refactor in data_utils.py based on DRY, and it cleaned things up nicely.
I noticed repeated code in multiple functions:
So I extracted that into a helper:
Each function just calls _fetch_all(...), which reduces repetition and makes intent clearer.
Flake8 issue:
from queries import *Flake8 flagged wildcard imports with:
from queries import *used; unable to detect undefined names.Why this happened:
Fix:
Used explicit imports, e.g.
I refactored the module to remove repeated DB code and kept each function focused on its query. I also replaced
from queries import *with explicit imports to clarify dependencies and avoid Flake8 F403/F405 warnings.Refactored data_utils.py
Hope it helps anyone else working through the same chapter.
Adrian
Beta Was this translation helpful? Give feedback.
All reactions