-
Notifications
You must be signed in to change notification settings - Fork 27
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
Use lead for end-date in spine + document empty opportunity table solution #48
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-jamie great job on this PR. I only have one small question, but other than that this looks good to go!
{% if var('salesforce__lead_enabled', True) %} | ||
select max( created_date ) as max_date from {{ source('salesforce', 'lead') }} | ||
{% else %} | ||
select coalesce(max( created_date ), '2024-01-01') as max_date from {{ source('salesforce', 'opportunity') }} |
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.
Should we consider changing the default to just be the current date instead of hard coding 2024-01-01
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.
ah because of this line, we end up choosing the current date anyways!
but perhaps this whole snippet is ultimately kinda roundabout and unnecessary -- is the last_date ever going to be greater than the current date, or should we just automatically choose the current_date? changing it entirely might be venturing out of scope i suppose though
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.
Ahh okay I see now. Yeah this is a bit roundabout and not entirely necessary. I think we can open a FR to clean up this logic in the future to make it more streamlined. I would agree that this is a bit out of scope for the final hours of the sprint.
This looks good to go!
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.
FR made! #49
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
PR Overview
This PR will address the following Issue/Feature:
#47
This PR will result in the following new package version:
v1.0.1
Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:
Bug Fix
last_date_query
logic in theint_salesforce__date_spine
model with thefirst_date_query
logic. This ensures that users with emptyopportunity
tables will have a valid end-date (based onlead
instead ofopportunity
) for thesalesforce__daily_activity
end model.int_salesforce__date_spine
to ensure a succesful run withoutlead
data.Documentation
opportunity
table can still have the package run successfully for them. See README for details.Under the Hood
PR Checklist
Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
salesforce__lead_enabled
Before marking this PR as "ready for review" the following have been applied:
Detailed Validation
Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":
Ran locally with lead_enabled turn off and on (off is essentially prod behavior).
Runs were successful and the row count did not change with our test data
i also did this with an empty opportunity table (i removed all records from the opportunity seed file and ran the package off the seed files)
Standard Updates
Please acknowledge that your PR contains the following standard updates:
dbt Docs
Please acknowledge that after the above were all completed the below were applied to your branch:
If you had to summarize this PR in an emoji, which would it be?
🧷