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

Feature/enable null urls #25

Merged

Conversation

fivetran-catfritz
Copy link
Contributor

@fivetran-catfritz fivetran-catfritz commented Dec 8, 2022

Are you a current Fivetran customer?

Fivetran created PR.
What change(s) does this PR introduce?

  • For use in the dbt_ad_reporting package, users can now allow records having nulls in url fields to be included in the ad_reporting__url_report model.
  • Disabled the not_null test for facebook_ads__url_report when null urls are allowed

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

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

  • Yes, Issue/Feature #59
  • No

How did you test the PR changes?

  • BuildKite
  • 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-catfritz fivetran-catfritz changed the base branch from main to MagicBot/dbt-utils-cross-db-migration December 8, 2022 17:13
Copy link
Contributor

@fivetran-sheringuyen fivetran-sheringuyen 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-catfritz, great job on the PR!

I made a few in-line comments and have an additional few here:

  • I think it may be worth it to update the DECISIONLOG.md file as it refers to the UTM report currently and it's supposed to be renamed to the URL report - decisions re the model should still be relevant though. However, if this is something you feel is out of scope, you can just create an issue for it so that we're documenting it for the future.

  • I believe that these updates to the models will indeed warrant a regeneration of docs.

{{ 'False' | as_bool }}
{%- else -%}
{{ 'True' | as_bool }}
{%- endif -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

I see what you're doing here, and I think you're definitely on the right track. This could potentially be simplified and you can check out apple_search_ads_source and twitter ads source. With these examples, you could use an 'or' statement rather than an 'and' statement to accomplish the same thing here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I think I get it now after reading below comment! Ok I will update. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually Ok I remember now--I initially tried to do something like that but got tripped up because I have to pass false if the variable is true, whereas in the example it would use true if one of the variables was true right? I will noodle on this more however. Though now I'm 2nd guessing if I should have used something more like "disable null filter" = True...

Copy link
Contributor Author

@fivetran-catfritz fivetran-catfritz Dec 13, 2022

Choose a reason for hiding this comment

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

Suggest to use only ad_reporting__using_null_url_filter default is True.

models/facebook_ads__url_report.sql Outdated Show resolved Hide resolved
CHANGELOG.md Outdated
[PR #25](https://github.com/fivetran/dbt_facebook_ads/pull/25) includes the following changes:
## 🎉 Features 🎉
- Added ability for a user to allow records having nulls in url fields to be included in the `facebook_ads__url_report` model. This is done by setting one of the variables below to `True` in your `dbt_project.yml` file.
- Note that using the variable `allow_ad_reporting_null_urls` will allow records with null urls for ALL Fivetran ad packages included in your project.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think depending on what you answer to the below question re: the intended variable interpretation, it would be valuable to highlight it here. Like what is the expectation from the customer re: declaring the variables. Can they declare allow_ad_reporting_null_urls as true but declare facebook_ads__url_report as false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They technically can, though I guess the way I want it to work is that the allow_ad_reporting_null_urls would win since I'm using an or between the two variable versions, and nulls would be allowed everywhere. My thought was either you could allow it on individual packages or all of them at once since the default is false.

For example, if someone wanted all them to have nulls except facebook for whatever reason, they would allow on each of the other packages individually and either set facebook variable to false or not set it at all. Up for debate on the best approach, but this is what I went with.

CHANGELOG.md Outdated
```
- Updated README with this information.
## 🚘 Under the Hood 🚘
- Disabled the `not_null` test for `facebook_ads__url_report` when null urls are allowed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Good job on including this!

Copy link
Contributor

Choose a reason for hiding this comment

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

I know you like consistency, so I just moved the PR references to the end of each section like below:

Suggested change
- Disabled the `not_null` test for `facebook_ads__url_report` when null urls are allowed.
- Disabled the `not_null` test for `facebook_ads__url_report` when null urls are allowed [[#25](https://github.com/fivetran/dbt_facebook_ads/pull/25)].

where creatives.url is not null
on report.account_id = accounts.account_id

{% if (var('allow_facebook_ads_null_urls', False)==False and var('allow_ad_reporting_null_urls', False)==False) %}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
{% if (var('allow_facebook_ads_null_urls', False)==False and var('allow_ad_reporting_null_urls', False)==False) %}
{% if var('ad_reporting__using_null_url_filter', True) %}

Copy link
Contributor

@fivetran-sheringuyen fivetran-sheringuyen 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-catfritz! Thanks for the productive session this morning - there are mostly some minor updates here that were held over from the previous version of the PR. But the tests and the model updates make sense to me!

README.md Outdated Show resolved Hide resolved
.buildkite/scripts/run_models.sh Outdated Show resolved Hide resolved
.buildkite/scripts/run_models.sh Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
fivetran-catfritz and others added 2 commits December 14, 2022 12:37
Co-authored-by: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com>
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
fivetran-catfritz and others added 6 commits December 14, 2022 14:38
Co-authored-by: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com>
@fivetran-catfritz fivetran-catfritz merged commit 5e3e03e into MagicBot/dbt-utils-cross-db-migration Dec 15, 2022
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