fivetran / dbt_klaviyo

https://fivetran.github.io/dbt_klaviyo/
Apache License 2.0
5 stars 6 forks source link

try_cast error in the klaviyo__person_campaign_flow model #21

Closed satdaya closed 1 year ago

satdaya commented 2 years ago

Is there an existing issue for this?

Describe the issue

when running the klaviyo package in Snowflake, an error message appears concerning the use of try_cast with types float and number(38, 0). when migrating the compiled code to snowflake, the model runs when try_cast is removed.

Relevant error log or model output

`15:14:41  Completed with 1 error and 0 warnings:
15:14:41  
15:14:41  Database Error in model klaviyo__person_campaign_flow (models/klaviyo__person_campaign_flow.sql)
15:14:41    001065 (22023): SQL compilation error:
15:14:41    Function TRY_CAST cannot be used with arguments of types FLOAT and NUMBER(38,0)
15:14:41    compiled SQL at target/run/klaviyo/models/klaviyo__person_campaign_flow.sql`

Expected behavior

the model to run without error

dbt Project configurations

name: 'ao_project' version: '1.0.0' require-dbt-version: '1.0.4'

config-version: 2

Cloning variables

vars: shopify_database: ao shopify_schema: tct_shopify_fivetran

Databases

# Roles
role_to_own: tct_admin
# Schemas to clone
schemas_to_clone: [
     "reporting", "tct_shopify", "scratch", "etl"
    ]
databases_to_clone: ["ao","tct"]
klaviyo_database: ao
klaviyo_schema: tct_klaviyo

This setting configures which "profile" dbt uses for this project.

profile: 'rho-ao'

These configurations specify where dbt should look for different types of files.

The source-paths config, for example, states that models in this project can be

found in the "models/" directory. You probably won't need to change these!

model-paths: ["models"] analysis-paths: ["analysis"] test-paths: ["tests"] seed-paths: ["data"] macro-paths: ["macros"] snapshot-paths: ["snapshots"]

target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by dbt clean

seeds: database: "tct" schema: "etl" enabled: true quote_columns: false

Configuring models

Full documentation: https://docs.getdbt.com/docs/configuring-models

models: transient: false copy_grants: true ao_project: ao: database: ao materialized: view etl: schema: etl database: ao materialized: view description: The transformation pipelines and SQL models to move data from the raw schema into the transformed schema tct: database: tct materialized: view etl: schema: etl database: tct materialized: view description: The transformation pipelines and SQL models to move data from the raw schema into the transformed schema

Package versions

packages:

What database are you using dbt with?

snowflake

dbt Version

1.0.4

Additional Context

No response

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

fivetran-joemarkiewicz commented 1 year ago

This was integrated within the v0.3.8 release of the package and the issue should now be resolved. Closing the Issue.