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

Employ base tables to resolve unioning-null issue #25

Merged
merged 17 commits into from
Mar 3, 2025

Conversation

fivetran-jamie
Copy link
Contributor

@fivetran-jamie fivetran-jamie commented Feb 19, 2025

PR Overview

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

This PR will result in the following new package version:

v0.1.0-a7

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

TO BE FINALIZED AFTER APPROVAL

Bug Fixes

  • Fixed an issue in which unioned source connections were producing null models.
    • The solution required the addition of a base staging model layer. For each staging model, there is a *_base counterpart in which we are running our union_data macro. This framework is necessary to the cooperation of our unioning and column-filling macros, which ensure the models do not fail if you are missing an expected column.
    • For each connector type, this adds:
      • 10 more models if Hubspot is enabled
      • 5 more models if Jira is enabled
      • 3 more models if Zendsk is enabled

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:

Running on prod using the the union schema/db variables (without the single schema variable set) on test data:
image

Running the same configs with this branch:
image

As for the consistency data validation tests, I am getting a peculiar error that makes it seem like this PR is resolving another bug 🤔

This is an example chunk from prod. Note the UNKOWN comment details

Deal Name : test_deal_3

Created By : UNKNOWN (test_contact_1053@test.com)
Created On : 2022-11-06 09:07:13.862+00
Company Name: test_company_3
Engagement Type: NOTE


## COMMENTS

Engagement type: Note
### message from UNKNOWN (UNKNOWN)
##### sent @ 2023-03-04 14:26:46.392+00
n88

The same record in dev differs only in that it has known comment details

Deal Name : test_deal_3

Created By : UNKNOWN (test_contact_1053@test.com)
Created On : 2022-11-06 09:07:13.862+00
Company Name: test_company_3
Engagement Type: NOTE


## COMMENTS

Engagement type: Note
### message from Fivetran Developers (email@name.com)
##### sent @ 2023-03-04 14:26:46.392+00
n88

This is the case for all failed rows. They are different on dev bc they are more seemingly complete

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

💒

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-jamie I haven't finished the review, but wanted to call out this one comment regarding the join to make sure we're taking the appropriate approach.

@@ -29,7 +29,7 @@ final as (
"grouped.comments_group_markdown"]) }}
as chunk
from deal_document
join grouped
inner join grouped
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like in PR #24 @levonkorganyan is proposing to change this to a left join instead. Let's sync to make sure we're making the right update.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Bumping this message as this is the only other remaining question in this PR before approval.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pinged Levon in his PR

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-jamie this PR looks great! I have two callouts that I'd like to be looked into before approval. Let me know if you have any questions!

@@ -29,7 +29,7 @@ final as (
"grouped.comments_group_markdown"]) }}
as chunk
from deal_document
join grouped
inner join grouped
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bumping this message as this is the only other remaining question in this PR before approval.

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.

LGTM!

fivetran-jamie and others added 2 commits February 28, 2025 08:32
Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com>
- `int_rag_hubspot__deal_document`
- `int_rag_jira__issue_document`
- `int_rag_zendesk__ticket_document`

Copy link
Contributor

Choose a reason for hiding this comment

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

@fivetran-jamie Since Levon contributed this PRto this release, we should probably add him as a contributor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added!

Copy link
Contributor

@fivetran-avinash fivetran-avinash left a comment

Choose a reason for hiding this comment

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

@fivetran-jamie Some questions before final approval.

fivetran-jamie and others added 2 commits February 28, 2025 16:14
Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com>
Copy link
Contributor

@fivetran-avinash fivetran-avinash left a comment

Choose a reason for hiding this comment

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

lgtm

@fivetran-jamie fivetran-jamie merged commit 11a445c into main Mar 3, 2025
8 checks passed
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] Source not working as expected when using union feature and default single schema not present
3 participants