Skip to content
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/dbt add core sensor to int #31

Merged
merged 2 commits into from
Feb 27, 2024
Merged

Conversation

kiranvasudev
Copy link
Member

@kiranvasudev kiranvasudev commented Feb 23, 2024

DATA-1750

The changes in this PR make sure to get the parents of an intermediate table and add it as an input to the dbt task config. By doing this, we can make sure that data flows through int models as they are updated in the staging layer of DBT(which is connected to the core layer)

Test case:

I used the fct_final_order_transmission table as an example to generate the task config. For this, the output dbt task config adds the first upstream dependencies of the model until either models in the staging layer are parents and/or a materialized table/view is a parent. For example, below is the entire lineage of the parents of fct_final_order_transmission:
image

The box in red are the inputs that are defined for this model.

link to dbt docs page

and here are the inputs that are generated by the code:

- name: int_user__order_preference
  type: dummy
  follow_external_dependency: true
- name: stg_core_chats__chat_user_lookup
  type: dummy
  follow_external_dependency: true
- type: athena
  follow_external_dependency: true
  schema: chats
  table: chat_user_lookup
  name: chats__chat_user_lookup_athena
- name: stg_core_users__user
  type: dummy
  follow_external_dependency: true
- type: athena
  follow_external_dependency: true
  schema: users
  table: user
  name: users__user_athena
- name: stg_core_users__order_preference
  type: dummy
  follow_external_dependency: true
- type: athena
  follow_external_dependency: true
  schema: users
  table: order_preference
  name: users__order_preference_athena
- name: int_crm__final_order_transmission
  type: dummy
  follow_external_dependency: true
- name: stg_core_orders__order_transmissioned
  type: dummy
  follow_external_dependency: true
- type: athena
  follow_external_dependency: true
  schema: orders
  table: order_transmissioned
  name: orders__order_transmissioned_athena
- type: athena
  follow_external_dependency: true
  schema: analytics_engineering
  table: fct_order
  name: analytics_engineering__fct_order_athena
- type: s3
  name: analytics_engineering__fct_order_s3
  bucket: cho${ENV}-data-lake
  path: dwh/analytics_engineering/analytics/fct_order

this is done to keep track of dependencies of int models that are ephemeral
@claudiazi
Copy link

lgtm!

@kiranvasudev kiranvasudev marked this pull request as ready for review February 26, 2024 08:42
@kiranvasudev kiranvasudev requested a review from a team as a code owner February 26, 2024 08:42
Copy link

@claudiazi claudiazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@kiranvasudev kiranvasudev merged commit 750f53e into master Feb 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants