-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add management command to patch ahhs data. #632
Conversation
47c8391
to
f87a5ed
Compare
f87a5ed
to
678fac9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
c99f349
to
7b0f4df
Compare
|
||
class Command(BaseCommand): | ||
|
||
help = "Fix AHHS household size data." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help = "Fix AHHS household size data." | |
help = "Patch AHHS household size data." |
logger.info("2024 AHHS data fixed successfully.") | ||
except FileNotFoundError: | ||
logger.error(f"CSV file at {csv_file_path} not found.") | ||
except Exception: | ||
logger.error("Failed to fix 2024 AHHS data:", exc_info=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.info("2024 AHHS data fixed successfully.") | |
except FileNotFoundError: | |
logger.error(f"CSV file at {csv_file_path} not found.") | |
except Exception: | |
logger.error("Failed to fix 2024 AHHS data:", exc_info=True) | |
logger.info("AHHS data patched successfully.") | |
except FileNotFoundError: | |
logger.error(f"CSV file at {csv_file_path} not found.") | |
except Exception: | |
logger.error("Failed to patch AHHS data:", exc_info=True) |
self.stdout.write(f'Figure id not found ids: {figure_id_not_found}') | ||
self.stdout.write(f'Figure unit not household ids: {change_in_unit_figures}') | ||
self.stdout.write(f'Change in reported value figure ids: {change_in_reported_value_figures}') | ||
self.stdout.write(f'No change in household size figure ids: {no_change_in_household_figures}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we log these as error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, shouldn't we use logger?
self.stdout.write(f'Change in reported value figure ids: {change_in_reported_value_figures}') | ||
self.stdout.write(f'No change in household size figure ids: {no_change_in_household_figures}') | ||
self.stdout.write(f'Total number of figures patched: {len(patched_figure_ids)}') | ||
self.stdout.write(f'Figure Ids patched with old household and total figures: {patched_figure_ids}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.stdout.write(f'Figure Ids patched with old household and total figures: {patched_figure_ids}') | |
self.stdout.write(f'IDs of figures patched: {patched_figure_ids}') |
7b0f4df
to
9ea7621
Compare
9ea7621
to
148fb11
Compare
self.stdout.write(f"Total number of figures patched: {len(patched_figure_ids)}") | ||
self.stdout.write(f"IDs of figures patched: {patched_figure_ids}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not have any information.
cd88c9c
to
1459fb2
Compare
1459fb2
to
5c4087c
Compare
- Additionally log bulk update summary
5c4087c
to
48d2693
Compare
Addresses
Changes
This PR doesn't introduce any:
print
This PR contains valid:
CSV File
manually_updated_ahhs_figures_mar_13.csv