Closed nszoni closed 1 year ago
Hi @nszoni thanks so much for opening this Issue and I am sorry you are experiencing this bug.
I would believe the inclusion of the ad_reporting__apple_search_ads_enabled: False
would properly disable the entire apple ad source file and not run the source freshness.
Before delving too deep I am curious about one item in particular. Would you be able to try and lowercase the false
in your variable declarations for the apple ads variables. I have experienced dbt getting confused with the mixed casing in the past and want to rule that out initially.
hey @fivetran-joemarkiewicz thanks for taking this up! I've tried keeping all of them lowercase, but it still wants to check the apple ad source.
Hi @nszoni thanks for checking my suspicious and showing that there is something more going on here. I have been able to replicate your variables in my local environment and notice the same error you are seeing.
I have been able to narrow the issue down to this line within the Apple Search Ads Source package.
Our intention is that this enablement would be disabled if either (or both) the apple search variables are set to false
. However, after checking the under the hood rendering, it looks like it simply returns as False and False
which does not in fact disable the source freshness. I am currently tinkering to see what new config would work to achieve the expected outcome we are looking for. I will be sure the share an update once I find the fix!
On the topic of the False and False
rendering, I just stumbled upon this Issue from dbt-core that mentions this exact issue and how there is no validation for situations like this.
It seems dbt Labs released a fix in dbt-core v1.3.1 that raises a more appropriate warning. I imagine if we both upgrade to the latest v1.3.1 then we will se the appropriate error. Nevertheless, I will continue working to uncover a fix for this issue.
@fivetran-joemarkiewicz nice catch! I will also keep investigating if i find something else:) Thanks!
Looks like my team and I were able to find the root cause! When we adjusted the line noted above to be the below snippet it worked as intended!
config:
enabled: "{{ var('ad_reporting__apple_search_ads_enabled', true) and var('apple_search_ads__using_search_terms', true) }}"
This should result in a quick update to the apple_search_ads_source package to use the above line in place of what we currently have.
I noticed you are open to creating a PR to fix this issue. Would you be interested in opening a PR on our Apple Search Ads Source package to address this? Otherwise we can fold this update into our coming sprint.
Awesome! Sure thing! Will do it tomorrow:) Thanks a ton!
@jonatfivetran here you go!:) 👆
Thanks again for the contributor @nszoni 🏅
Now that the apple_search_ads_source PR has been merged and released, this issue should be resolved. Closing out this issue. Please feel free to reopen if the issue persists.
Is there an existing issue for this?
Describe the issue
Turning off the usage of Apple ads platform as stated in the package README doesn't actually turn off source freshness tests for the models, although the config is conditioned on the variable set to
False
Relevant error log or model output
Expected behavior
I would expect dbt not running source freshness tests for Apple because we are not creating those.
dbt Project configurations
Package versions
What database are you using dbt with?
bigquery
dbt Version
Additional Context
No response
Are you willing to open a PR to help address this issue?