GithubHelp home page GithubHelp logo

fivetran / dbt_facebook_ads_source Goto Github PK

View Code? Open in Web Editor NEW
14.0 38.0 15.0 2.42 MB

Fivetran data models for Facebook Ads built using dbt.

Home Page: https://fivetran.github.io/dbt_facebook_ads_source/

License: Apache License 2.0

Shell 100.00%
dbt dbt-packages fivetran facebook-ads

dbt_facebook_ads_source's Introduction

Facebook Ads Source dbt Package (Docs)

📣 What does this dbt package do?

  • Materializes Facebook Ads staging tables which leverage data in the format described by this ERD. These staging tables clean, test, and prepare your facebook_ads data from Fivetran's connector for analysis by doing the following:
    • Name columns for consistency across all packages and for easier analysis
    • Adds freshness tests to source data
    • Adds column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values.
  • Generates a comprehensive data dictionary of your Facebook Ads data through the dbt docs site.
  • These tables are designed to work simultaneously with our Facebook Ads transformation package.

🎯 How do I use the dbt package?

Step 1: Prerequisites

To use this dbt package, you must have the following:

  • At least one Fivetran Facebook Ads connector syncing data into your destination.
  • A BigQuery, Snowflake, Redshift, PostgreSQL, or Databricks destination.
  • You will need to configure your Facebook Ads connector to pull the basic_ad pre-built report. This pre-built report should be enabled in your connector by default. However, to confirm this pre-built report is actively syncing you may perform the following steps:
    1. Navigate to the connector schema tab.
    2. Search for basic_ad and confirm it is selected.
    3. If not selected, do so and sync. If already selected you are ready to run the models!

Databricks Dispatch Configuration

If you are using a Databricks destination with this package you will need to add the below (or a variation of the below) dispatch configuration within your dbt_project.yml. This is required in order for the package to accurately search for macros within the dbt-labs/spark_utils then the dbt-labs/dbt_utils packages respectively.

dispatch:
  - macro_namespace: dbt_utils
    search_order: ['spark_utils', 'dbt_utils']

Step 2: Install the package (skip if also using the facebook_ads transformation package)

Include the following facebook_ads_source package version in your packages.yml file.

TIP: Check dbt Hub for the latest installation instructions or read the dbt docs for more information on installing packages.

packages:
  - package: fivetran/facebook_ads_source
    version: [">=0.7.0", "<0.8.0"] # we recommend using ranges to capture non-breaking changes automatically

Step 3: Define database and schema variables

By default, this package runs using your destination and the facebook_ads schema. If this is not where your Facebook Ads data is (for example, if your facebook_ads schema is named facebook_ads_fivetran), add the following configuration to your root dbt_project.yml file:

vars:
    facebook_ads_database: your_destination_name
    facebook_ads_schema: your_schema_name 

(Optional) Step 4: Additional configurations

Union multiple connectors

If you have multiple facebook_ads connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the source_relation column of each model. To use this functionality, you will need to set either the facebook_ads_union_schemas OR facebook_ads_union_databases variables (cannot do both) in your root dbt_project.yml file:

vars:
    facebook_ads_union_schemas: ['facebook_ads_usa','facebook_ads_canada'] # use this if the data is in different schemas/datasets of the same database/project
    facebook_ads_union_databases: ['facebook_ads_usa','facebook_ads_canada'] # use this if the data is in different databases/projects but uses the same schema name

Please be aware that the native source.yml connection set up in the package will not function when the union schema/database feature is utilized. Although the data will be correctly combined, you will not observe the sources linked to the package models in the Directed Acyclic Graph (DAG). This happens because the package includes only one defined source.yml.

To connect your multiple schema/database sources to the package models, follow the steps outlined in the Union Data Defined Sources Configuration section of the Fivetran Utils documentation for the union_data macro. This will ensure a proper configuration and correct visualization of connections in the DAG.

Passing Through Additional Metrics

By default, this package will select clicks, impressions, and cost from the source reporting tables to store into the staging models. If you would like to pass through additional metrics to the staging models, add the below configurations to your dbt_project.yml file. These variables allow for the pass-through fields to be aliased (alias) if desired, but not required. Use the below format for declaring the respective pass-through variables:

Note Please ensure you exercised due diligence when adding metrics to these models. The metrics added by default (taps, impressions, and spend) have been vetted by the Fivetran team maintaining this package for accuracy. There are metrics included within the source reports, for example metric averages, which may be inaccurately represented at the grain for reports created in this package. You will want to ensure whichever metrics you pass through are indeed appropriate to aggregate at the respective reporting levels provided in this package.

vars:
    facebook_ads__basic_ad_passthrough_metrics: 
      - name: "new_custom_field"
        alias: "custom_field"
      - name: "another_one"

Change the build schema

By default, this package builds the Facebook Ads staging models within a schema titled (<target_schema> + _facebook_ads_source) in your destination. If this is not where you would like your Facebook Ads staging data to be written to, add the following configuration to your root dbt_project.yml file:

models:
    facebook_ads_source:
      +schema: my_new_schema_name # leave blank for just the target_schema

Change the source table references

If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:

IMPORTANT: See this project's dbt_project.yml variable declarations to see the expected names.

vars:
    facebook_ads_<default_source_table_name>_identifier: your_table_name 

(Optional) Step 5: Orchestrate your models with Fivetran Transformations for dbt Core™

Expand for more details

Fivetran offers the ability for you to orchestrate your dbt project through Fivetran Transformations for dbt Core™. Learn how to set up your project for orchestration through Fivetran in our Transformations for dbt Core™ setup guides.

🔍 Does this package have dependencies?

This dbt package is dependent on the following dbt packages. Please be aware that these dependencies are installed by default within this package. For more information on the following packages, refer to the dbt hub site.

IMPORTANT: If you have any of these dependent packages in your own packages.yml file, we highly recommend that you remove them from your root packages.yml to avoid package version conflicts.

packages:
    - package: fivetran/fivetran_utils
      version: [">=0.4.0", "<0.5.0"]

    - package: dbt-labs/dbt_utils
      version: [">=1.0.0", "<2.0.0"]

    - package: dbt-labs/spark_utils
      version: [">=0.3.0", "<0.4.0"]

🙌 How is this package maintained and can I contribute?

Package Maintenance

The Fivetran team maintaining this package only maintains the latest version of the package. We highly recommend that you stay consistent with the latest version of the package and refer to the CHANGELOG and release notes for more information on changes across versions.

Contributions

A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions!

We highly encourage and welcome contributions to this package. Check out this dbt Discourse article to learn how to contribute to a dbt package!

🏪 Are there any resources available?

  • If you have questions or want to reach out for help, please refer to the GitHub Issue section to find the right avenue of support for you.
  • If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our Feedback Form.
  • Have questions or want to be part of the community discourse? Create a post in the Fivetran community and our team along with the community can join in on the discussion!

dbt_facebook_ads_source's People

Contributors

alex-ilyichov avatar dylanbaker avatar fivetran-avinash avatar fivetran-catfritz avatar fivetran-jamie avatar fivetran-joemarkiewicz avatar fivetran-sheringuyen avatar jlmendgom5tran avatar kristin-bagnall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbt_facebook_ads_source's Issues

[Bug] basic_ads does not exist

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

The models reference a basic_ads table which isn't currently created by the connector

Relevant error log or model output

No response

Expected behavior

No error

dbt Project configurations

Nothing specific to this package

Package versions

packages:

  • package: fivetran/facebook_ads_source
    version: [">=0.5.0", "<0.6.0"]

What database are you using dbt with?

postgres

dbt Version

Core:

installed: 1.2.3
latest: 1.3.1 - Update available!
Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Plugins:

postgres: 1.2.3 - Update available!
At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

FEATURE - Indicate how to configure Fivetran connector

Are you a Fivetran customer?
Yes. Alejo Buxeres, Wallbox Chargers

Is your feature request related to a problem? Please describe.
If we don't configure Fivetran Facebook Ads connector correctly, basic_ad table is missing

Describe the solution you'd like
Describe in the README how to configure Fivetran Facebook Ads connector (see: https://fivetran.com/docs/applications/facebook-ads). I suppose we need to configure a Table called "basic_ad" with the pre-configured report "BASIC_AD" at a day granularity.

Describe alternatives you've considered

Additional context

Please indicate the level of urgency and business impact of this request

Are you interested in contributing to this package?

  • Yes, I can do this and open a PR for your review.
  • Possibly, but I'm not quite sure how to do this. I'd be happy to do a live coding session with someone to get this work implemented.
  • No, I'd prefer if someone else did this. I don't have the time and/or don't know how to incorporate the changes necessary.

[Feature] Add documentation on differences among aggregations across different grains

Copied from fivetran/dbt_ad_reporting #92.

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

Some customers have brought up concerns on why sums are different across different grains, for example why spend is not the same summed up across the ad level versus the campaign level.

Example from Joe regarding a recent customer inquiry:

"The reason for this discrepancy is due to not all ads being served at the ad level. There are some ads that are only served at the ad group/campaign/etc. levels. This means that you can have ads sent at the campaign level and that counts towards your total spend. However, since the ad was never sent at an individual ad level, it will not be included.
This was a large reason for us breaking the ad reporting package into separate hierarchical end models. Because we found when we only used the ad level, we were missing data as some ads were not served at an ad level, but were served at a campaign level."

We should add more context like above to our ad packages READMEs as a proactive measure.

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

[Feature] Add union schema capability

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

Issue for adding the union schema capability.

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

[Bug] Quickstart transformations failed because basic_ad table wasn't found

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

I've configured the Facebook Ads connector and enabled all available Quickstart transformations for Facebook Ads:

image

However, all Quickstart transformations are failing because of the same reason: it appears the basic_ad table wasn't found:

23:26:36  Completed with 1 error and 0 warnings:
23:26:36  
23:26:36  Runtime Error in model stg_facebook_ads__basic_ad_tmp (models/tmp/stg_facebook_ads__basic_ad_tmp.sql)
23:26:36    404 Not found: Table daikin-be:facebook_ads.basic_ad was not found in location EU
23:26:36    
23:26:36    Location: EU
23:26:36    Job ID: 8b32ee04-6654-49a7-aa08-f93b1566c9a3
23:26:36    
23:26:36  
23:26:36  Done. PASS=12 WARN=0 ERROR=1 SKIP=6 TOTAL=19

This seems odd since according to this documentation: https://fivetran.com/docs/applications/facebook-ads/prebuilt-reports, the basic_ad table is included in the 21 prebuilt reports that are created by default upon activating the Facebook Ads connector.

Relevant error log or model output

dbt run --models +facebook_ads__url_report +facebook_ads__ad_set_report +facebook_ads__account_report +facebook_ads__campaign_report +facebook_ads__ad_report
23:26:16  Running with dbt=1.3.1
23:26:16  Partial parse save file not found. Starting full parse.
23:26:21  Found 19 models, 30 tests, 0 snapshots, 0 analyses, 541 macros, 0 operations, 0 seed files, 6 sources, 0 exposures, 0 metrics
23:26:21  
23:26:23  Concurrency: 4 threads (target='prod')
23:26:23  
23:26:23  1 of 19 START sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__account_history_tmp  [RUN]
23:26:23  2 of 19 START sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__ad_history_tmp  [RUN]
23:26:23  3 of 19 START sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__ad_set_history_tmp  [RUN]
23:26:23  4 of 19 START sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__basic_ad_tmp  [RUN]
23:26:26  4 of 19 ERROR creating sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__basic_ad_tmp  [ERROR in 2.29s]
23:26:26  5 of 19 START sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__campaign_history_tmp  [RUN]
23:26:26  3 of 19 OK created sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__ad_set_history_tmp  [CREATE VIEW (0 processed) in 2.82s]
23:26:26  2 of 19 OK created sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__ad_history_tmp  [CREATE VIEW (0 processed) in 2.84s]
23:26:26  7 of 19 SKIP relation facebook_ads_facebook_ads_source.stg_facebook_ads__basic_ad  [SKIP]
23:26:26  8 of 19 START sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__ad_set_history  [RUN]
23:26:26  6 of 19 START sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__creative_history_tmp  [RUN]
23:26:26  1 of 19 OK created sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__account_history_tmp  [CREATE VIEW (0 processed) in 3.08s]
23:26:26  9 of 19 START sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__ad_history  [RUN]
23:26:28  5 of 19 OK created sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__campaign_history_tmp  [CREATE VIEW (0 processed) in 2.16s]
23:26:28  10 of 19 START sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__account_history  [RUN]
23:26:28  6 of 19 OK created sql view model facebook_ads_facebook_ads_source.stg_facebook_ads__creative_history_tmp  [CREATE VIEW (0 processed) in 2.10s]
23:26:28  11 of 19 START sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__campaign_history  [RUN]
23:26:30  9 of 19 OK created sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__ad_history  [CREATE TABLE (18.0 rows, 2.0 KB processed) in 3.18s]
23:26:30  12 of 19 START sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__creative_history  [RUN]
23:26:30  8 of 19 OK created sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__ad_set_history  [CREATE TABLE (11.0 rows, 1.5 KB processed) in 3.64s]
23:26:31  10 of 19 OK created sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__account_history  [CREATE TABLE (2.0 rows, 178.0 Bytes processed) in 2.89s]
23:26:31  11 of 19 OK created sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__campaign_history  [CREATE TABLE (10.0 rows, 1.2 KB processed) in 2.40s]
23:26:31  13 of 19 SKIP relation facebook_ads_facebook_ads.facebook_ads__account_report .. [SKIP]
23:26:31  14 of 19 SKIP relation facebook_ads_facebook_ads.facebook_ads__ad_report ....... [SKIP]
23:26:31  15 of 19 SKIP relation facebook_ads_facebook_ads.facebook_ads__ad_set_report ... [SKIP]
23:26:31  16 of 19 SKIP relation facebook_ads_facebook_ads.facebook_ads__campaign_report . [SKIP]
23:26:32  12 of 19 OK created sql table model facebook_ads_facebook_ads_source.stg_facebook_ads__creative_history  [CREATE TABLE (15.0 rows, 2.7 KB processed) in 2.43s]
23:26:32  17 of 19 START sql table model facebook_ads_facebook_ads.facebook_ads__url_tags  [RUN]
23:26:34  17 of 19 OK created sql table model facebook_ads_facebook_ads.facebook_ads__url_tags  [CREATE TABLE (6.0 rows, 958.0 Bytes processed) in 2.20s]
23:26:34  18 of 19 START sql view model facebook_ads_facebook_ads.int_facebook_ads__creative_history  [RUN]
23:26:36  18 of 19 OK created sql view model facebook_ads_facebook_ads.int_facebook_ads__creative_history  [CREATE VIEW (0 processed) in 1.38s]
23:26:36  19 of 19 SKIP relation facebook_ads_facebook_ads.facebook_ads__url_report ...... [SKIP]
23:26:36  
23:26:36  Finished running 7 view models, 12 table models in 0 hours 0 minutes and 14.53 seconds (14.53s).
23:26:36  
23:26:36  Completed with 1 error and 0 warnings:
23:26:36  
23:26:36  Runtime Error in model stg_facebook_ads__basic_ad_tmp (models/tmp/stg_facebook_ads__basic_ad_tmp.sql)
23:26:36    404 Not found: Table daikin-be:facebook_ads.basic_ad was not found in location EU
23:26:36    
23:26:36    Location: EU
23:26:36    Job ID: 8b32ee04-6654-49a7-aa08-f93b1566c9a3
23:26:36    
23:26:36  
23:26:36  Done. PASS=12 WARN=0 ERROR=1 SKIP=6 TOTAL=19

Expected behavior

The basic_ad table should be created given the basic config of the Facebook Ads connector. All Quickstart transformations should run succesfully.

dbt Project configurations

These are Quickstart transformations provided by Fivetran.

Package versions

These are Quickstart transformations provided by Fivetran.

What database are you using dbt with?

bigquery

dbt Version

1.6.6

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Bug] Can't Pull Through Reach

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

reach is already being pulled through manually in stg_facebook_ads__basic_ad.sql so when I try to pass through reach using the below I get a duplicate field and the model can't run. I need to pass through the field for subsequent models using the dbt_facebook_ads repo. I believe the same would be true for frequency.

facebook_ads__basic_ad_passthrough_metrics: 
  - name: "reach"

Relevant error log or model output

with base as (
    select * 
    from `analytics-dev-406710`.`alex_analytics_dev_package_fivetran_ads_source`.`stg_facebook_ads__basic_ad_tmp`
),
fields as (
    select
        
    
    
    ad_id
    
 as 
    
    ad_id
    
, 
    
    
    ad_name
    
 as 
    
    ad_name
    
, 
    
    
    adset_name
    
 as 
    
    adset_name
    
, 
    
    
    date
    
 as 
    
    date
    
, 
    
    
    account_id
    
 as 
    
    account_id
    
, 
    
    
    impressions
    
 as 
    
    impressions
    
, 
    
    
    inline_link_clicks
    
 as 
    
    inline_link_clicks
    
, 
    
    
    spend
    
 as 
    
    spend
    
, 
    
    
    reach
    
 as 
    
    reach
    
, 
    
    
    frequency
    
 as 
    
    frequency
    
, 
    
    
    reach
    
 as 
    
    reach
    
        
    
        
, cast('' as STRING) as source_relation
    from base
),
final as (
    select
        source_relation, 
        cast(ad_id as bigint) as ad_id,
        ad_name,
        adset_name as ad_set_name,
        date as date_day,
        cast(account_id as bigint) as account_id,
        impressions,
        coalesce(inline_link_clicks,0) as clicks,
        spend,
        reach,
        frequency
        
    
        
            
                , reach
            
        
    
    from fields
)
select * 
from final

Expected behavior

I would expect reach to not be in the initial list of variables so that when the macro adds it there are no duplicate fields. This would then allow the model to run.

dbt Project configurations

facebook_ads__basic_ad_passthrough_metrics: 
  - name: "reach"

Package versions

packages:

  - package: dbt-labs/dbt_utils
    version: [">=1.0.0", "<2.0.0"]
  
  - package: Velir/ga4
    version: 5.1.0

  - package: fivetran/google_ads
    version: [">=0.10.0", "<0.11.0"]
  
  - package: fivetran/facebook_ads
    version: [">=0.7.0", "<0.8.0"]

  - package: fivetran/instagram_business
    version: [">=0.2.0", "<0.3.0"]

What database are you using dbt with?

bigquery

dbt Version

Core:

  • installed: 1.6.6
  • latest: 1.7.13 - Update available!

Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Plugins:

  • bigquery: 1.6.7 - Update available!

At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Bug] Incorrect test config on `stg_facebook_ads__creative_history`

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

I have added the ad_reporting package to my project and dbt run was successful for all models. However, I'm getting an error when testing the results because of apparent duplicates in stg_facebook_ads__creative_history. This is the only test that is failing.

The output of this model is filtered by the two directly downstream (facebook_ads__url_tags and int_facebook_ads__creative_history), which use the is_most_recent_record column to remove older rows.

Temporary workaround

Using the package name and full identifier in my project file let me disable the test and pass CI:

# dbt_project.yml
tests:
  facebook_ads_source:
    dbt_utils_unique_combination_of_columns_stg_facebook_ads__creative_history_source_relation__creative_id___fivetran_synced:
      +enabled: false

Fix

Adding a where clause in the test config prevents the error:

# stg_facebook_ads.yml
  - name: stg_facebook_ads__creative_history
    description: Each record in this table reflects a Facebook creative.
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - source_relation
            - creative_id
            - _fivetran_synced
          config:
            where: is_most_recent_record

Let me know if this an acceptable solution and I will open a PR to make the change 🙂

Relevant error log or model output

# dbt test -s package:facebook_ads_source
13:42:45  Running with dbt=1.6.9
13:42:45  Registered adapter: bigquery=1.6.9
13:42:46  Unable to do partial parsing because a project config has changed
13:42:50  Found 106 models, 3 seeds, 181 tests, 35 sources, 0 exposures, 9 metrics, 907 macros, 0 groups, 1 semantic model
13:42:50  
13:42:52  Concurrency: 4 threads (target='dev')
13:42:52  
13:42:52  1 of 18 START test dbt_utils_unique_combination_of_columns_stg_facebook_ads__account_history_source_relation__account_id___fivetran_synced  [RUN]
13:42:52  2 of 18 START test dbt_utils_unique_combination_of_columns_stg_facebook_ads__ad_history_source_relation__ad_id__updated_at  [RUN]
13:42:52  3 of 18 START test dbt_utils_unique_combination_of_columns_stg_facebook_ads__ad_set_history_source_relation__ad_set_id__updated_at  [RUN]
13:42:52  4 of 18 START test dbt_utils_unique_combination_of_columns_stg_facebook_ads__basic_ad_source_relation__date_day__ad_id__account_id  [RUN]
13:42:53  4 of 18 PASS dbt_utils_unique_combination_of_columns_stg_facebook_ads__basic_ad_source_relation__date_day__ad_id__account_id  [PASS in 1.23s]
13:42:53  5 of 18 START test dbt_utils_unique_combination_of_columns_stg_facebook_ads__campaign_history_source_relation__campaign_id__updated_at  [RUN]
13:42:53  3 of 18 PASS dbt_utils_unique_combination_of_columns_stg_facebook_ads__ad_set_history_source_relation__ad_set_id__updated_at  [PASS in 1.25s]
13:42:53  6 of 18 START test dbt_utils_unique_combination_of_columns_stg_facebook_ads__creative_history_source_relation__creative_id___fivetran_synced  [RUN]
13:42:53  1 of 18 PASS dbt_utils_unique_combination_of_columns_stg_facebook_ads__account_history_source_relation__account_id___fivetran_synced  [PASS in 1.28s]
13:42:53  7 of 18 START test not_null_stg_facebook_ads__account_history__fivetran_synced . [RUN]
13:42:53  2 of 18 PASS dbt_utils_unique_combination_of_columns_stg_facebook_ads__ad_history_source_relation__ad_id__updated_at  [PASS in 1.29s]
13:42:53  8 of 18 START test not_null_stg_facebook_ads__account_history_account_id ....... [RUN]
13:42:54  5 of 18 PASS dbt_utils_unique_combination_of_columns_stg_facebook_ads__campaign_history_source_relation__campaign_id__updated_at  [PASS in 1.22s]
13:42:54  8 of 18 PASS not_null_stg_facebook_ads__account_history_account_id ............. [PASS in 1.17s]
13:42:54  9 of 18 START test not_null_stg_facebook_ads__ad_history_ad_id ................. [RUN]
13:42:54  6 of 18 FAIL 4 dbt_utils_unique_combination_of_columns_stg_facebook_ads__creative_history_source_relation__creative_id___fivetran_synced  [FAIL 4 in 1.22s]
13:42:54  10 of 18 START test not_null_stg_facebook_ads__ad_history_updated_at ........... [RUN]
13:42:54  11 of 18 START test not_null_stg_facebook_ads__ad_set_history_ad_set_id ........ [RUN]
13:42:54  7 of 18 PASS not_null_stg_facebook_ads__account_history__fivetran_synced ....... [PASS in 1.24s]
13:42:54  12 of 18 START test not_null_stg_facebook_ads__ad_set_history_updated_at ....... [RUN]
13:42:56  12 of 18 PASS not_null_stg_facebook_ads__ad_set_history_updated_at ............. [PASS in 1.19s]
13:42:56  13 of 18 START test not_null_stg_facebook_ads__basic_ad_account_id ............. [RUN]
13:42:56  11 of 18 PASS not_null_stg_facebook_ads__ad_set_history_ad_set_id .............. [PASS in 1.25s]
13:42:56  14 of 18 START test not_null_stg_facebook_ads__basic_ad_ad_id .................. [RUN]
13:42:56  9 of 18 PASS not_null_stg_facebook_ads__ad_history_ad_id ....................... [PASS in 1.29s]
13:42:56  15 of 18 START test not_null_stg_facebook_ads__campaign_history_campaign_id .... [RUN]
13:42:56  10 of 18 PASS not_null_stg_facebook_ads__ad_history_updated_at ................. [PASS in 1.35s]
13:42:56  16 of 18 START test not_null_stg_facebook_ads__campaign_history_updated_at ..... [RUN]
13:42:57  13 of 18 PASS not_null_stg_facebook_ads__basic_ad_account_id ................... [PASS in 1.06s]
13:42:57  17 of 18 START test not_null_stg_facebook_ads__creative_history__fivetran_synced  [RUN]
13:42:57  15 of 18 PASS not_null_stg_facebook_ads__campaign_history_campaign_id .......... [PASS in 1.10s]
13:42:57  18 of 18 START test not_null_stg_facebook_ads__creative_history_creative_id .... [RUN]
13:42:57  16 of 18 PASS not_null_stg_facebook_ads__campaign_history_updated_at ........... [PASS in 1.06s]
13:42:57  14 of 18 PASS not_null_stg_facebook_ads__basic_ad_ad_id ........................ [PASS in 1.19s]
13:42:58  17 of 18 PASS not_null_stg_facebook_ads__creative_history__fivetran_synced ..... [PASS in 1.12s]
13:42:58  18 of 18 PASS not_null_stg_facebook_ads__creative_history_creative_id .......... [PASS in 1.13s]
13:42:58  
13:42:58  Finished running 18 tests in 0 hours 0 minutes and 7.86 seconds (7.86s).
13:42:58  
13:42:58  Completed with 1 error and 0 warnings:
13:42:58  
13:42:58  Failure in test dbt_utils_unique_combination_of_columns_stg_facebook_ads__creative_history_source_relation__creative_id___fivetran_synced (models/stg_facebook_ads.yml)
13:42:58    Got 4 results, configured to fail if != 0
13:42:58  
13:42:58    compiled Code at target/compiled/facebook_ads_source/models/stg_facebook_ads.yml/dbt_utils_unique_combination_o_e48f84c8ad4c2d29a6b840a1e0b5f2ee.sql
13:42:58  
13:42:58  Done. PASS=17 WARN=0 ERROR=1 SKIP=0 TOTAL=18

Expected behavior

The tests pass or accurately reflect an error that needs to be fixed.

dbt Project configurations

models:
  ad_reporting:
    +schema: ad_reporting

  apple_search_ads:
    +schema: apple_search_ads
  apple_search_ads_source:
    +schema: apple_search_ads_source
  
  facebook_ads:
    +schema: facebook_ads
  facebook_ads_source:
    +schema: facebook_ads_source
  
  google_ads:
    +schema: google_ads
  google_ads_source:
    +schema: google_ads_source


vars:
  apple_search_ads_schema: fivetran_apple_search_ads
  facebook_ads_schema: fivetran_facebook_ads
  google_ads_schema: fivetran_google_ads
  ad_reporting__amazon_ads_enabled: False
  ad_reporting__linkedin_ads_enabled: False
  ad_reporting__microsoft_ads_enabled: False
  ad_reporting__pinterest_ads_enabled: False
  ad_reporting__reddit_ads_enabled: False
  ad_reporting__snapchat_ads_enabled: False
  ad_reporting__tiktok_ads_enabled: False
  ad_reporting__twitter_ads_enabled: False

Package versions

packages:
  - package: LewisDavies/upstream_prod
    version: [">=0.7.0", "<0.8.0"]
  - package: dbt-labs/dbt_utils
    version: [">=1.1.0", "<1.2.0"]
  - package: fivetran/ad_reporting
    version: [">=1.7.0", "<1.8.0"]

What database are you using dbt with?

bigquery

dbt Version

1.6.9

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

Bug - URL column

Hi! Thanks for a great package!!
I think maybe the column "url" should be removed from the yaml file, as it is not created in staging, and not requested in the creative_history sql file? We have a enabled persisted docs, and this column therefore creates an error.
(I am a bit new to this, so forgive me if there is something I am missing here..)

FEATURE - Postgres Compatiblity

Are you a Fivetran customer?

A user has requested for the Facebook suite to be compatible with Postgres. I think we should explore the efforts of making the rest of the ad reporting package compatible as well.

Is your feature request related to a problem? Please describe.

No problem, just a note to upgrade the package compatibility to include Postgres.

Describe the solution you'd like

The Facebook and Ad packages be compatible with Postgres users.

Describe alternatives you've considered

None

Please indicate the level of urgency and business impact of this request

Low level urgency

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.