fivetran / dbt_amazon_ads_source

Fivetran's Amazon Ads Source dbt package
https://fivetran.github.io/dbt_amazon_ads_source/
Apache License 2.0
4 stars 6 forks source link

[Bug] Small typo in boolean logic for `config: enabled` #6

Closed jtcohen6 closed 1 year ago

jtcohen6 commented 1 year ago

Is there an existing issue for this?

Describe the issue

This results in "False and True", which is not a valid boolean value:

https://github.com/fivetran/dbt_amazon_ads_source/blob/ba849f3e77d153e3cc8548f9f2d9b6b5dd8b31ac/models/src_amazon_ads.yml#L167-L168

This results in an admittedly gross validation error in dbt-core:

hologram.ValidationError: 'False and True' is not of type 'boolean'

Failed validating 'type' in schema['properties']['enabled']:
    {'default': True, 'type': 'boolean'}

On instance['enabled']:
    'False and True'

Change to:

 config: 
   enabled: "{{ var('ad_reporting__amazon_ads_enabled', true) and var('amazon_ads__portfolio_history_enabled', true) }}" 

(Notice the condition is now fully inside the Jinja, rather than templating a string)__

Relevant error log or model output

No response

Expected behavior

Does not raise validation error

dbt Project configurations

vars:
  ...
  # Ads Reporting
  ad_reporting__amazon_ads_enabled: False

Package versions

17:42:18  Installing fivetran/amazon_ads_source
17:42:20    Installed from version 0.1.0
17:42:20    Up to date!

What database are you using dbt with?

snowflake

dbt Version

$ dbt --version
Core:
  - installed: 1.4.0
  - latest:    1.4.1 - Update available!

Additional Context

No response

Are you willing to open a PR to help address this issue?

fivetran-joemarkiewicz commented 1 year ago

Thanks again for raising this to our team and helping to address this issue! This has since been addressed within PR #5 and is now live on the hub.

As such, the issue should be addressed and I will close this bug report. Please feel free to reopen if the issue persists on your end 😄