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

bug/email-metrics-variable #105

Merged
merged 16 commits into from
May 3, 2023

Conversation

fivetran-catfritz
Copy link
Contributor

@fivetran-catfritz fivetran-catfritz commented Apr 27, 2023

PR Overview

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

This PR will result in the following new package version:

v0.9.1 - This is non-breaking as it will not affect model outputs.

Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:
The models listed below generate metrics by iterating through a list of fields:

  • hubspot__contacts
  • hubspot__email_campaigns
  • int_hubspot__email_metrics__by_contact_list

This list of metrics is set by default, which means that some of the values in this default list may not exist in upstream tables if their sources are disabled. This can result in a run error.

To address this issue, I created a macro that checks for the presence of these extra columns and removes them from the list. Note that the default list has been moved to the macro to remove setting the variable within dbt_project.yml to avoid any potential conflicts with a user's dbt_project.yml.

PR Checklist

Basic Validation

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

  • dbt compile
  • dbt run --full-refresh
  • dbt run
  • dbt test
  • dbt run --vars '{hubspot_email_event_status_change_enabled: false}'

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

  • The appropriate issue has been linked and tagged
  • You are assigned to the corresponding issue and this PR
  • BuildKite integration tests are passing

Detailed Validation

Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":

  • You have validated these changes and assure this PR will address the respective Issue/Feature.
  • You are reasonably confident these changes will not impact any other components of this package or any dependent packages.
  • You have provided details below around the validation steps performed to gain confidence in these changes.
  • Reproduce the issue by using the test data that does not include the source email_event_status_change (see internal ticket for details) and setting hubspot_email_event_status_change_enabled: false. You can only reproduce the error when this table is not present.
  • After making the code adjustments, the error no longer occurs, and the compiled code does not show the missing columns.
  • (Pending customer feedback.)

Standard Updates

Please acknowledge that your PR contains the following standard updates:

  • Package versioning has been appropriately indexed in the following locations:
    • indexed within dbt_project.yml
    • indexed within integration_tests/dbt_project.yml
  • CHANGELOG has individual entries for each respective change in this PR
  • [NA] README updates have been applied (if applicable)
  • [NA] DECISIONLOG updates have been updated (if applicable)
  • [NA] Appropriate yml documentation has been added (if applicable)

dbt Docs

Please acknowledge that after the above were all completed the below were applied to your branch:

  • docs were regenerated (unless this PR does not include any code or yml updates)

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

🚜

@fivetran-catfritz fivetran-catfritz linked an issue Apr 28, 2023 that may be closed by this pull request
4 tasks
@fivetran-catfritz fivetran-catfritz self-assigned this Apr 28, 2023
@fivetran-catfritz fivetran-catfritz changed the base branch from main to release/v0.9.1 April 28, 2023 16:59
Copy link
Contributor

@fivetran-reneeli fivetran-reneeli left a comment

Choose a reason for hiding this comment

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

Tested with the configs you sent and it ran on my end, and the macro makes sense!

@fivetran-catfritz fivetran-catfritz merged commit e6ab8df into release/v0.9.1 May 3, 2023
@fivetran-catfritz fivetran-catfritz mentioned this pull request May 3, 2023
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.

[Bug] Missing column in intermediate model if variable is set
2 participants