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

Nov 2024 schema #18

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Nov 2024 schema #18

wants to merge 29 commits into from

Conversation

fivetran-reneeli
Copy link
Contributor

@fivetran-reneeli fivetran-reneeli commented Jan 29, 2025

PR Overview

This PR will address the following Issue/Feature: #28

This PR will result in the following new package version: v0.5.0

Schema changes from Nov 2024

Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:

to be completed

PR Checklist

Basic Validation

Please acknowledge that you have successfully performed the following commands locally:

  • dbt run –full-refresh && dbt test
  • dbt run (if incremental models are present) && dbt test

Before marking this PR as "ready for review" the following have been applied:

  • The appropriate issue has been linked, tagged, and properly assigned
  • All necessary documentation and version upgrades have been applied
  • docs were regenerated (unless this PR does not include any code or yml updates)
  • BuildKite integration tests are passing
  • Detailed validation steps have been provided below

Detailed Validation

Please share any and all of your validation steps:

If you had to summarize this PR in an emoji, which would it be?

💃

cast(platform_version as {{ dbt.type_string() }}) as platform_version,
cast(source_type as {{ dbt.type_string() }}) as source_type,
cast(page_type as {{ dbt.type_string() }}) as page_type,
cast(pre_order as {{ dbt.type_string() }}) as pre_order,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just fyi. would have thought this is a boolean but apple docs has it as a string.

Copy link
Collaborator

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

@fivetran-reneeli thanks for this PR. A few comments below following this review.

{{
fivetran_utils.fill_staging_columns(
source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__app_session_tmp')),
staging_columns=get_app_session_detailed_daily_columns()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this staging_columns parameter pointing at the correct macro?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just double checked, yes I believe so. Are you asking because the name is different? I cut off some of the characters because some warehouses had issue with long file names.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks! Yeah it was tripping me up that the names were divergent. But this makes sense and I can see the same approach used for other models in this update. No change required here.

cast(original_start_date as date) as original_start_date,
cast(device as {{ dbt.type_string() }}) as device,
cast(client as {{ dbt.type_string() }}) as client,
cast(state as {{ dbt.type_string() }}) as state,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you confirm the state and quantity case statements are no longer necessary in this schema?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assume you meant the device case statement rather than quantity; for that one, I didn't see any values needing cleanup.

For state, actually now I noticed ' ' present in the data so thanks for calling attention to that-- I will add that case logic back for state.

from fields
{{ dbt_utils.group_by(9) }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did the grain of this model change? Is there a reason we no longer need this group by?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup I changed the grain-- I thought it was non-standard to have aggregations in the staging model. I understand why it was done (to only filter to relevant columns and aggregating quantity to ensure all values are captured), but I figured it made more sense to have everything in staging, then keep the aggregations in the transforms like how we have it elsewhere.

cast(proceeds_reason as {{ dbt.type_string() }}) as proceeds_reason,
cast(subscription_offer_name as {{ dbt.type_string() }}) as subscription_offer_name,
cast(promotional_offer_id as {{ dbt.type_string() }}) as promotional_offer_id,
cast(state as {{ dbt.type_string() }}) as state,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question regarding if you confirm the state and quantity case statements are no longer necessary in this schema?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same comment as above

from fields
{{ dbt_utils.group_by(8) }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question regarding the grain of this model and why we grouped by before, but not now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same comment as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants