You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BigQuery allows stringy dataset names that contain only digits, but dbt fails at startup if such a dataset name is provided. Is this a function of dbt's new NativeEnvironment rendering for jinja?
Steps To Reproduce
Use a profile like:
dev:
type: bigquery
method: service-account
project: '...'
dataset: "1991" # This is the important part
threads: 1
keyfile: ...
location: US
timeout_seconds: 1
retries: 3
A dbt run will fail indicating that the provided profile is invalid:
Credentials in profile "bq", target "dev" invalid: 1991 is not of type 'string'
Expected behavior
dbt should create models in a dataset named 1991
dbt version
dev/octavius-catto
The text was updated successfully, but these errors were encountered:
Is this a function of dbt's new NativeEnvironment rendering for jinja?
Yes, almost certainly. I can think of two ways to approach this:
figure out how to tell the renderer that "this value should come out as a string". I'm not sure if that's hard or not, but I bet it isn't simple. This probably involves something neat with native_concat and marker types/custom filters?
figure out how to tell the validator "if you expected a string, call str on it". That's actually kind of tricky in the general case, because we don't really control validation, so we'd probably need to separately descend in, comparing it to the dataclass being serialized, and mutate the source dict before we get to the validator. Hideous!
Ok, I've thought about this, and I think there is a third ok-ish option: Add a custom filter to jinja that says "treat this field as text no matter what". Then you'd use it like dataset: "{{ 1991 | is_text }}". I think it would only make sense in the native rendering, but we could add it as a pass-through in the text renderer if we needed.
Describe the bug
BigQuery allows stringy dataset names that contain only digits, but dbt fails at startup if such a dataset name is provided. Is this a function of dbt's new NativeEnvironment rendering for jinja?
Steps To Reproduce
Use a profile like:
A
dbt run
will fail indicating that the provided profile is invalid:Expected behavior
dbt should create models in a dataset named
1991
dbt version
The text was updated successfully, but these errors were encountered: