-
Notifications
You must be signed in to change notification settings - Fork 3
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] Fix concatenation issue with null values creating null rows in Snowflake #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-avinash great work on this PR and thanks for uncovering and addressing the list of bugs in the model. I have a few more comments before approval. Once these are addressed this will be ready for pre-release.
models/intermediate/hubspot/int_rag_hubspot__deal_comment_documents_grouped.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-joemarkiewicz Changes addressed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one last comment to update README
@@ -1,6 +1,28 @@ | |||
# dbt_unified_rag v0.1.0-a6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies I didn't realize this before. Be sure to update the install version in the README with the new -a6 version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
PR Overview
This PR will address the following Issue/Feature: [#20]
This PR will result in the following new package version: v0.1.0-a6
This ensures null fields gets populated but shouldn't change the schema.
Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:
Bug Fixes (requires
--full-refresh
)coalesce_cast
macro to all relevant fields that are being concatenated intocomment_markdown
, as any concatenation in Snowflake with a null value returns null. We coalesced 'UNKNOWN' on a string field, and '1970-01-01 00:00:00' on a timestamp field to ensure Snowflake returns chunks of texts for all comments with null components.int_rag_hubspot__deal_comment_document
:email_title
andbody
(string fields),comment_time
(timestamp field).int_rag_hubspot__deal_document
:title
(string field) andcreated_on
(timestamp field).int_rag_jira__issue_comment_document
:comment_body
(string field) andcomment_time
(timestamp field).int_rag_jira__issue_document
:title
(string field) andcreated_on
(timestamp field).int_rag_zendesk__ticket_comment_document
:comment_body
(string field) andcomment_time
(timestamp field).int_rag_zendesk__ticket_document
:title
(string field) andcreated_on
(timestamp field).default_variable
instg_rag_hubspot__engagement_email
andstg_rag_hubspot__engagement_note
.engagement_deal
is the base in theint_rag_hubspot__deal_comment_document
CTEs.Under the Hood
PR Checklist
Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
Before marking this PR as "ready for review" the following have been applied:
Detailed Validation
Please share any and all of your validation steps:
Was able to reproduce the issue in Snowflake by running the compiled code with a null value that is concatenated and it returning nulls there. Adding the coalesces with the compiled code did produce the full row span expected.
The lone validation test worked too.
If you had to summarize this PR in an emoji, which would it be?
🪹