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

Issue with model stg_stripe__invoice_line_items build #2

Open
emilefyon opened this issue Nov 4, 2022 · 1 comment
Open

Issue with model stg_stripe__invoice_line_items build #2

emilefyon opened this issue Nov 4, 2022 · 1 comment

Comments

@emilefyon
Copy link

Hello,

I have an issue when running the build of the model stg_stripe__invoice_line_items :

select
    _airbyte_invoice_line_items_hashid,
    {{ dbt_date.from_unixtimestamp('start') }} as period_start,
    {{ dbt_date.from_unixtimestamp(**'"end"'**) }} as period_end
from {{ var('invoice_line_items_period') }}

I receive the following issue:

No matching signature for function TIMESTAMP_SECONDS for argument types: STRING. Supported signature: TIMESTAMP_SECONDS(INT64) at [15:9]
compiled Code at target/run/airbyte_stripe/models/tmp/stg_stripe__invoice_line_items.sql

When changing the quote to those:

select
    _airbyte_invoice_line_items_hashid,
    {{ dbt_date.from_unixtimestamp('start') }} as period_start,
    {{ dbt_date.from_unixtimestamp(**'`end`'**) }} as period_end
from {{ var('invoice_line_items_period') }}

I then get the following issue:

No matching signature for function TIMESTAMP_SECONDS for argument types: FLOAT64. Supported signature: TIMESTAMP_SECONDS(INT64) at [15:9]
compiled Code at target/run/airbyte_stripe/models/tmp/stg_stripe__invoice_line_items.sql

The datatype in my schema are the following ones:
image

And I am using the standard Transformation in Airbyte with Normalized tabulart data

image

Any input would be great :-)

@emilefyon
Copy link
Author

It does properly run when running this (I know it's super messy, just wanted to try):

init as (
    select
        _airbyte_invoice_line_items_hashid,
        start,
        cast(`end` as int64) as `end` 
    from {{ var('invoice_line_items_period') }}
),

invoice_line_items_period as (
    select
        _airbyte_invoice_line_items_hashid,
        {{ dbt_date.from_unixtimestamp('start') }} as period_start,
        {{ dbt_date.from_unixtimestamp('`end`') }} as period_end
    from init
),

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

No branches or pull requests

1 participant