-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature/click uri deprecation #69
base: main
Are you sure you want to change the base?
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.
Reviewed! Another question I had was I wanted to confirm text_ad_landing_page
and spotlight_landing_page
are exclusive? So there's no case where customer can have both.
never mind-- I see the internal thread that this has been discussed already!
@fivetran-reneeli, confirmed with product and engineering that it is exclusive. You will not have both. It will always either be one or the other. See my other responses in the comments above. Let me know if you have other questions. |
Thanks @fivetran-joemarkiewicz just followed up! And regarding the ad type exclusivity, I saw the internal thread that this has been discussed already! |
Thanks @fivetran-reneeli! I just made the change in the CHANGELOG to reflect the proper macro name. This should be good for re-review. |
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!
macros/is_table_empty.sql
Outdated
{%- macro default__is_table_empty(table_name) -%} | ||
{%- if execute and flags.WHICH in ('run', 'build') %} | ||
{% set row_count_query %} | ||
select count(*) as row_count from {{ table_name }} |
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.
I'm wondering, do we need to count the entire table if we're just checking if the table is empty? Not that there are many cases where there are a billion records in Linkedin that could impact query execution, but wondering if just checking a subset would still get us the intended result.
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.
Interesting point 🤔. What would you recommend for adjusting this to count the entire table?
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 Would something like
{%- macro default__is_table_empty(table_name) -%}
{%- if execute and flags.WHICH in ('run', 'build') %}
{% set row_check_query %}
SELECT 1
FROM {{ table_name }}
LIMIT 1
{% endset %}
{% set results = run_query(row_check_query) %}
{% if results and results.rows | length == 0 %}
{{ return("empty") }}
{% endif %}
{% endif -%}
{%- endmacro -%}
work? The length would be 1 if there's a row (and thus not empty), and 0 if not.
(or something along those lines).
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.
I like this idea, but if we were to implement it then I'd want to validate this a bit more since it is more than just a one line code change.
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.
Sensible! Just a suggestion anyway, this PR is approved.
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 I thought more about this and wanted to make try some tests to see if we could get this more performant option working before release. I was able to get this working in the latest commit. See the validations below. Let me know your thoughts!
(Edit): There is a comment in most of these screenshots that says the below schema is populated. Please note this is only relevant for the first screenshot it appears. For all the others it was simply not removed by accident. You can use the names of the schemas as the guide.
-
✅ When running on an empty schema, the macro works as expected.
-
✅ When running on a populated schema, the macro works as expected.
-
✅ When running on two populated union schemas, the macro works as expected.
-
✅ When running on two union schemas which are empty, the macro works as expected.
Would you be able to take a second look and let me know if you have any notes before this moves forward.
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.
I also reran the downstream integration tests and saw success. So it looks like we are in the clear that this doesn't cause downstream issues.
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.
Was able to replicate several of these setups, so I'd say it's safe to move forward.
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 A few comments before release, but nothing blocking. Approved!
Co-authored-by: Avinash Kunnath <[email protected]>
PR Overview
This PR will address the following Issue/Feature: LinkedIn Ads Issue #35
This PR will result in the following new package version:
v0.10.0
This will be a breaking change since we are adding a new field. Additionally, there are major changes to the
click_uri
field to support the new LinkedIn Ads API and connector schema updates. Therefore, it would be most appropriate to list this as a breaking change so users are made fully aware.Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:
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:
Please see the downstream dbt_linkedin PR #38 for further validation details.
Additionally, I was able to confirm the
click_uri
andclick_uri_type
fields were populating as expected in thestg_linkedin_ads__creative_history
model. You can see the text_ad and spotlight types populating as expected. However, thenull
records forhttp://www.github.com
are expected since they are populated by the deprecatedclick_uri
(per the seed data) field and should be displayed asnull
.If you had to summarize this PR in an emoji, which would it be?
🔗