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

Bugfix/email send idi #26

Merged
merged 7 commits into from
Aug 24, 2022
Merged

Bugfix/email send idi #26

merged 7 commits into from
Aug 24, 2022

Conversation

fivetran-reneeli
Copy link
Contributor

Pull Request
Are you a current Fivetran customer?

Internal
What change(s) does this PR introduce?

Updates surrogate key email_send_id to include primary_attribute_value_id.

Did you update the CHANGELOG?

  • Yes

Does this PR introduce a breaking change?

  • [] Yes (please provide breaking change details below.)
  • No (please provide an explanation as to how the change is non-breaking below.)
    Updating a field

Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)

  • Yes

Is this PR in response to a previously created Bug or Feature Request

How did you test the PR changes?

  • CircleCi
  • Local (please provide additional testing details below)

Select which warehouse(s) were used to test the PR

  • BigQuery
  • Redshift
  • Snowflake
  • Postgres
  • Databricks
  • Other (provide details below)

Provide an emoji that best describes your current mood

💃

Feedback

We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your feedback on our existing dbt packages or what you'd like to see next.

@fivetran-reneeli
Copy link
Contributor Author

fivetran-reneeli commented Aug 19, 2022

Hey @fivetran-joemarkiewicz this is ready for review. As for testing it looks like our data only has one primary_attribute_value_id per campaign id so we're a little limited in testing to ensure, but I think it's straightforward enough where we'd be comfortable moving forward, what do you think?

with ranker as 
(
SELECT campaign_id, primary_attribute_value_id,campaign_run_id, lead_id, rank() over(partition by campaign_id, primary_attribute_value_id order by primary_attribute_value_id) as ranking FROM `dbt-package-testing.dbt_renee_stg_marketo.stg_marketo__activity_send_email` 
order by 1,2
)
select * from ranker where ranking != 1

Copy link
Contributor

@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.

Hey @fivetran-reneeli thanks for opening this PR. I am comfortable with the limited data we have. However, there are a few changes I think we need to make. It looks like the email_send_id is used in a downstream join but we only updated the field in the stg_marketo__activity_send_email model. Can we update this field in all other models where it is created (for example it also occurs in stg_marketo__activity_email_bounced? Additionally, we will need to update the yml definitions similarly where we update it.

Once those updates are applied, can you test that this branch works with the downstream dbt_marketo package. Since this is a patch release, we won't want to accidentally cut a release that can have downstream failures. Let me know if you have any questions.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated
- Updated surrogate key `email_send_id` to include `primary_attribute_value_id`. The previous key was at a campaign level grain, not an email level grain. This is pertinent in the case where there are multiple emails that part of the same campaign. (https://github.com/fivetran/dbt_marketo_source/issues/25)
[#26](https://github.com/fivetran/dbt_marketo_source/pull/26)
## Contributors
- [sfc-gh-sugupta](https://github.com/sfc-gh-sugupta)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you link the issue @sfc-gh-sugupta originally created. This was we can see their contribution since it is not a direct commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this wasn't added. Would you be able to link the issue next to the account name

@fivetran-reneeli
Copy link
Contributor Author

Hey @fivetran-reneeli thanks for opening this PR. I am comfortable with the limited data we have. However, there are a few changes I think we need to make. It looks like the email_send_id is used in a downstream join but we only updated the field in the stg_marketo__activity_send_email model. Can we update this field in all other models where it is created (for example it also occurs in stg_marketo__activity_email_bounced? Additionally, we will need to update the yml definitions similarly where we update it.

Once those updates are applied, can you test that this branch works with the downstream dbt_marketo package. Since this is a patch release, we won't want to accidentally cut a release that can have downstream failures. Let me know if you have any questions.

Thanks for catching that @fivetran-joemarkiewicz! I've updated email_send_id in the remaining stg models/ checked for the ones being used in the downstream joins. Ymls updated. Following that, downstream package works

Copy link
Contributor

@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.

Thanks for applying the changes @fivetran-reneeli! It looks like the CHANGELOG request from the last review was missed. Would you be able to make that update. Once that is applied, this is good to go!

CHANGELOG.md Outdated
- Updated surrogate key `email_send_id` to include `primary_attribute_value_id`. The previous key was at a campaign level grain, not an email level grain. This is pertinent in the case where there are multiple emails that part of the same campaign. (https://github.com/fivetran/dbt_marketo_source/issues/25)
[#26](https://github.com/fivetran/dbt_marketo_source/pull/26)
## Contributors
- [sfc-gh-sugupta](https://github.com/sfc-gh-sugupta)
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this wasn't added. Would you be able to link the issue next to the account name

@fivetran-reneeli fivetran-reneeli merged commit 2b66fcf into main Aug 24, 2022
@fivetran-reneeli fivetran-reneeli deleted the bugfix/email_send_idi branch August 24, 2022 19:54
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