-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
‘NoneType’ object cannot be interpreted as an integer #3353
Comments
Hey @yzwu1209, thanks for the report! I'd like to get to the bottom of this. Could you check |
do you want me to attach the log here? Thanks! |
@jtcohen6 Please find them below. I think this is the portion that's related to the error.
|
yes i'm using it: But it has never run into this error before. Any idea how to fix it? |
Got it! Okay, I'm able to reproduce this error by just creating a model that looks like: {%- for i in range(var('vaccine_count_maximum')): %}
select {{ i }}
{{ "union all" if not loop.last }}
{%- endfor -%}
I'm able to remove it by doing any of the following: Defining the var with a default value in vars:
vaccine_count_maximum: 2 Including a default value in the {%- for i in range(var('vaccine_count_maximum', 2)): %} Defining the variable on the CLI via the
In any event, that's a horrible error message. Ideally, we could wrap it in a helpful pointer to the failed-to-parse model name/file. The place where we catch Jinja templating errors is here: The exception here is actually coming from python, not Jinja, so if we just include the built-in
Then dbt's error message becomes:
Which is, at least, a better place to start! |
@jtcohen6 thank you so much for you prompt response. I have already defined the var in project yml. I'm wondering if the config format has changed in dbt@0.19.1? It looks to me that dbt is not picking up any vars that I defined in project yml. |
@yzwu1209 Ah, okay, interesting! What does your |
@jtcohen6 Yes, I have to include And I agree to your earlier message that dbt should display a more detailed error message otherwise user might debug in a totally wrong direction, or maybe just point user to Thank you for your support! |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
Describe the bug
Previously I was able to run the same scripts without any problem. I am using macOS Mojave 10.14.6. But after I upgraded to 0.19.1, somehow I can’t run any dbt command, except dbt debug.
For example, I run the following command:
dbt run -m MODEL_1 --profiles-dir ./profiles
(I create a profiles.yml under profiles folder; which has been working all along)I would get the following error.
I also ran
dbt debug --profiles-dir ./profiles
, and it showed thatI am not sure what went wrong. Could anyone give any insight? Thank you!
Expected behavior
The script should run without any issue and the table should be generated on snowflake like it used to.
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using: macOS Mojave 10.14.6
The output of
python --version
: Python 3.8.3Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: