-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-2516] [Bug] Upgrade to 1.5.0 generates "TypeError: argument of type 'PosixPath' is not iterable" on model runs. #7495
Comments
@christopherekfeldt Thanks for opening! I'm going to label this as a potential It's weird that this is happening during project parsing. Based on the error message and occurrence, I'd guess that you're accessing a flag that's being passed in, and trying to loop over it (?). Educated guesses - any chance you're doing one of the following?
Also - does your poetry package implicitly set any other flag values for dbt, via CLI flag or env var, such as |
No I don't think so. I searched it and found nothing in our project reflecting "invocation_args_dict". These are the packages specified in our packages.yml: packages:
On the last part my answer is no, we only have one project dir and a common profile in our dbt root folder. |
Heads up that the elementary package uses the invocation_args_dict variable: |
Okay, commented out all packages besides dbt-utils and removed dbt_packages/ folder and rerun "poetry run dbt deps". Getting the same output still when running dbt compile/run/build -s model_name |
That felt like a promising lead! However:
On looking again at the stacktrace, I'm now seeing that the error seems to crop up during hook parsing:
@christopherekfeldt Do you have any |
These are our hooks atm: on-run-start:
on-run-end:
|
So all 3 first hooks could be the bad guy here? should the logic be switched out for something else? |
Looking at the first hook you shared: - '{{ exceptions.raise_compiler_error("Cannot use .profiles as profiles dir locally.") if "/dbt/.profiles" in flags.PROFILES_DIR }}' That You can fix this immediately by explicitly converting - '{{ exceptions.raise_compiler_error("Cannot use .profiles as profiles dir locally.") if "/dbt/.profiles" in flags.PROFILES_DIR | string }}' We could also handle this within Lines 93 to 104 in 35f8ceb
from pathlib import Path
def get_flag_obj():
new_flags = Namespace()
for key, val in get_flag_dict().items():
if isinstance(val, Path):
val = str(val)
setattr(new_flags, key.upper(), val) That change makes sense to me more generally, anyway. |
Is this a new bug in dbt-core?
Current Behavior
We just upgraded our poetry packages for dbt-core and dbt-bigquery to 1.5.0.
When running: poetry run dbt --version everything works fine. But when calling a model like:
poetry run dbt run -s model_name
poetry run dbt build -s model_name
We get a new error never seen before.
Expected Behavior
That the models get built as prior with the normal CLI output.
Steps To Reproduce
Relevant log output
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: