Repository navigation
fix: update outlets and schedule datasets trigger to ODS_USERDATA #349
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
|
|
||
|
|
||
| with DAG( | ||
| dag_id="ODS_USER_INFO.info", | ||
| dag_id="ODS_USERDATA", | ||
| start_date=datetime(2024, 10, 1), | ||
| schedule=[Dataset("STG_USERDATA.info"), Dataset("STG_USERDATA.param"), Dataset("STG_UNION_MEMBER.union_member")], | ||
| catchup=False, | ||
|
|
@@ -31,7 +31,7 @@ | |
| # порядок датасетов здесь важен! | ||
| # см. info.sql и https://airflow.apache.org/docs/apache-airflow/stable/templates-ref.html#variables | ||
| inlets=[Dataset("STG_USERDATA.info"), Dataset("STG_USERDATA.param"), Dataset("STG_UNION_MEMBER.union_member")], | ||
| outlets=[Dataset("ODS_USER_INFO.info")], | ||
| outlets=[Dataset("ODS_USERDATA")], | ||
|
||
| params={"tablename": "info"}, | ||
| ) | ||
| # run_sql_encrypted = PostgresOperator( | ||
|
|
@@ -46,6 +46,6 @@ | |
| # Dataset("STG_USERDATA.param"), | ||
| # Dataset("STG_UNION_MEMBER.union_member"), | ||
| # ], | ||
| # outlets=[Dataset("ODS_USER_INFO.encrypted_info")], | ||
| # outlets=[Dataset("ODS_USERDATA.encrypted_info")], | ||
| # params={"tablename": "encrypted_info"}, | ||
| # ) TODO сделать мерж юсердаты шифрованной | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -273,10 +273,10 @@ def post_members_to_union_group_to_backend(union_members_ids: list): | |||||
| json=data, | ||||||
| ) | ||||||
| if response.status_code == 200: | ||||||
| logging.info(f"Updated group with union members {union_members_ids} from dwh database") | ||||||
| logging.info(f"Updated group with union member {union_member} from dwh database") | ||||||
| else: | ||||||
| logging.error( | ||||||
| f"Update group with union members {union_members_ids} copy to backend failed with code: {response.status_code}\n Response text: {response.text}" | ||||||
| f"Update group with union member {union_member} copy to backend failed with code: {response.status_code}\n Response text: {response.text}" | ||||||
| ) | ||||||
| except Exception as e: | ||||||
| logging.error(f"Error sending data to backend: {str(e)}") | ||||||
|
|
@@ -334,7 +334,8 @@ def remove_non_union_members_from_union_group(union_members_ids: list): | |||||
|
|
||||||
| with DAG( | ||||||
| dag_id="union_member_to_backend", | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Хорошо бы в этом даге еще добавить inlets в явном виде, чтобы видеть зависимость на графе |
||||||
| schedule=[Dataset("ODS_USERDATA.student_id")], | ||||||
| schedule=[Dataset("ODS_USERDATA")], | ||||||
|
||||||
| schedule=[Dataset("ODS_USERDATA")], | |
| schedule=[Dataset("ODS_USERDATA.student_id")], |

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.
Dataset naming in this repo appears to consistently follow the
SCHEMA.tablepattern (e.g.ODS_AUTH.user,ODS_RATING.comment, etc.). Introducing a schema-level dataset name without a dot (ODS_USERDATA) is inconsistent and can make lineage/triggering harder to reason about. Consider publishing a table-scoped dataset (e.g.ODS_USERDATA.student_id) or publishing multiple outlets for the tables written ininfo.sql, and update downstream schedules accordingly.