-
Notifications
You must be signed in to change notification settings - Fork 0
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
FIX: ODS Views and dmap-import sequences #45
Conversation
pass | ||
# Delete status files for all tables loaded since the NOT NULL Primary Key requirement was dropped. | ||
# This will force a reset/re-load for these tables in dmap-import DB | ||
s3_delete_object(os.path.join(ODS_STATUS, "EDW.PAYMENT_SUMMARY.json")) | ||
s3_delete_object(os.path.join(ODS_STATUS, "EDW.MEMBER_DIMENSION.json")) | ||
op.drop_table("edw_payment_summary", schema="ods") | ||
op.drop_table("edw_payment_summary_history", schema="ods") | ||
op.drop_table("edw_member_dimension", schema="ods") | ||
op.drop_table("edw_member_dimension_history", schema="ods") | ||
# This was one-time migration, does not need to remain active | ||
# s3_delete_object(os.path.join(ODS_STATUS, "EDW.PAYMENT_SUMMARY.json")) | ||
# s3_delete_object(os.path.join(ODS_STATUS, "EDW.MEMBER_DIMENSION.json")) | ||
# op.drop_table("edw_payment_summary", schema="ods") | ||
# op.drop_table("edw_payment_summary_history", schema="ods") | ||
# op.drop_table("edw_member_dimension", schema="ods") | ||
# op.drop_table("edw_member_dimension_history", schema="ods") |
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 was causing issues during local testing, should never need to be run again.
@@ -445,7 +445,7 @@ def snapshot_reset(self) -> None: | |||
self.etl_status = self.load_etl_status() | |||
|
|||
self.db.execute(drop_table(self.db_history_table)) | |||
self.db.execute(drop_table(self.db_fact_table)) | |||
self.db.truncate_table(self.db_fact_table, restart_identity=True, cascade=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.
Drop command was causing VIEWS to get dropped...
@@ -0,0 +1,134 @@ | |||
AD_HOC_VIEW = """ |
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.
Keep these VIEW statements in central location.
op.drop_table("edw_member_dimension", schema="ods") | ||
op.drop_table("edw_member_dimension_history", schema="ods") | ||
# This was one-time migration, does not need to remain active | ||
# s3_delete_object(os.path.join(ODS_STATUS, "EDW.PAYMENT_SUMMARY.json")) |
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.
I gotta tell you. This concept of using migrations to do other migration-related things blew my mind. 😂
This change includes the following: