Closed dioptre closed 1 year ago
Hi @dioptre thanks for opening this issue. I have actually never seen error logs or a recursive message like this 🤔.
A few quick questions:
account
table in your source?Let me know if you would be able to provide some additional insight following the above questions. This will help us understand what may be occurring in your implementation of the package.
The only thing I found that could cause an issue like this is the fact that the cte name in the failed models is the same name as the variable we are calling in the from statement.
This does seem to be consistent with the fact that the models which succeeded have different cte names from the variables being declared.
However, it is strange that when I am running the package on our internal Postgres AWS RDS instance this does not provide an error. Are you by chance hosting your Postgres instance on a different provider? Or are you using a different warehouse? I am trying to understand why you are seeing this error but our Postgres instance does not 🤔
Yes the account field does exist, will do some more exploring.
On Thu, Jul 20, 2023 at 3:08 PM Joe Markiewicz @.***> wrote:
The only thing I found that could cause an issue like this is the fact that the cte name in the failed models is the same name as the variable we are calling in the from statement.
See the cte name here https://github.com/fivetran/dbt_fivetran_log/blob/0e6d9b1cec1c38b840a63de78d7726dfd502df35/models/staging/stg_fivetran_log__account.sql#L1 (account) and the variable name here https://github.com/fivetran/dbt_fivetran_log/blob/0e6d9b1cec1c38b840a63de78d7726dfd502df35/models/staging/stg_fivetran_log__account.sql#L4 (account).
This does seem to be consistent with the fact that the models which succeeded have different cte names from the variables being declared.
See the cte name here https://github.com/fivetran/dbt_fivetran_log/blob/0e6d9b1cec1c38b840a63de78d7726dfd502df35/models/staging/stg_fivetran_log__user.sql#L3 (fivetran_user) and the variable name here https://github.com/fivetran/dbt_fivetran_log/blob/0e6d9b1cec1c38b840a63de78d7726dfd502df35/models/staging/stg_fivetran_log__user.sql#L6 (user).
However, it is strange that when I am running the package on our internal Postgres AWS RDS instance this does not provide an error. Are you by chance hosting your Postgres instance on a different provider? Or are you using a different warehouse? I am trying to understand why you are seeing this error but our Postgres instance does not 🤔
— Reply to this email directly, view it on GitHub https://github.com/fivetran/dbt_fivetran_log/issues/84#issuecomment-1644678982, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFZTGF7ZFOUEVCWUKVVUJDXRGT5JANCNFSM6AAAAAA2R7ETLQ . You are receiving this because you were mentioned.Message ID: @.***>
Any reason that you aren't sticking with the base, tmp_ nomenclature in all the other repos?
with base as (
select * from {{ ref('stg_quickbooks__bill_linked_txn_tmp') }}
),
fields as (
select / The below macro is used to generate the correct SQL for package staging models. It takes a list of columns that are expected/needed (staging_columns from dbt_quickbooks_source/models/tmp/) and compares it with columns in the source (source_columns from dbt_quickbooks_source/macros/). For more information refer to our dbt_fivetran_utils documentation ( https://github.com/fivetran/dbt_fivetran_utils.git). /
{{ fivetran_utils.fill_staging_columns( so
On Fri, Jul 21, 2023 at 12:18 PM Andrew Grosser @.***> wrote:
Yes the account field does exist, will do some more exploring.
On Thu, Jul 20, 2023 at 3:08 PM Joe Markiewicz @.***> wrote:
The only thing I found that could cause an issue like this is the fact that the cte name in the failed models is the same name as the variable we are calling in the from statement.
See the cte name here https://github.com/fivetran/dbt_fivetran_log/blob/0e6d9b1cec1c38b840a63de78d7726dfd502df35/models/staging/stg_fivetran_log__account.sql#L1 (account) and the variable name here https://github.com/fivetran/dbt_fivetran_log/blob/0e6d9b1cec1c38b840a63de78d7726dfd502df35/models/staging/stg_fivetran_log__account.sql#L4 (account).
This does seem to be consistent with the fact that the models which succeeded have different cte names from the variables being declared.
See the cte name here https://github.com/fivetran/dbt_fivetran_log/blob/0e6d9b1cec1c38b840a63de78d7726dfd502df35/models/staging/stg_fivetran_log__user.sql#L3 (fivetran_user) and the variable name here https://github.com/fivetran/dbt_fivetran_log/blob/0e6d9b1cec1c38b840a63de78d7726dfd502df35/models/staging/stg_fivetran_log__user.sql#L6 (user).
However, it is strange that when I am running the package on our internal Postgres AWS RDS instance this does not provide an error. Are you by chance hosting your Postgres instance on a different provider? Or are you using a different warehouse? I am trying to understand why you are seeing this error but our Postgres instance does not 🤔
— Reply to this email directly, view it on GitHub https://github.com/fivetran/dbt_fivetran_log/issues/84#issuecomment-1644678982, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFZTGF7ZFOUEVCWUKVVUJDXRGT5JANCNFSM6AAAAAA2R7ETLQ . You are receiving this because you were mentioned.Message ID: @.***>
The reason they are likely not in line is simply due to the Fivetran Log being an early package which didn't have the same standards when we initial built the package. That being said, this is an opportunity to update the staging models to be in line with our other package standards for staging models.
However, I am still curious why this would cause the failures you are seeing? Were you able to identify if there are any other differences to your environment that may be contributing to the error? I mainly want to understand so we can properly prevent this in the future if this is something we need to account for across our packages.
Would you be able to inspect the the target folder of your dbt project to view the materialized code of one of the failed models? I am wondering if the materialized code will give us any insight into the circular reference error.
Thanks @dioptre for raising this ticket! Our newest release covers the respective updates. Feel free to reach out with anything else!
Is there an existing issue for this?
Describe the issue
I get recursive errors running the dbt package:
Relevant error log or model output
No response
Expected behavior
Works
dbt Project configurations
default
Package versions
.7 - 0.8
What database are you using dbt with?
postgres
dbt Version
1.5.1
Additional Context
No response
Are you willing to open a PR to help address this issue?