-
Notifications
You must be signed in to change notification settings - Fork 123
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
Handle BigQuery non-string option 'max_staleness' #237
Handle BigQuery non-string option 'max_staleness' #237
Conversation
just ran into this myself! hoping this can get merged into a release soon |
Thank you @cbini! Do you know when it could be merged and a new version released? |
@marcbllv nope! I'm just another user who's having the same problem. Wanted to bump this to call attention to it. |
@marcbllv I think a cleaner solution is just to remove the check if its a string and do the quotes, if you need to pass a string into the options do so explicitly by setting the quotes in the YAML configuration. This solution adds more complexity instead of reducing it. |
@thomas-vl thanks for your answer! I agree on the added complexity of the code, but IMO it's fine since it decreases complexity on YAML configuration for users: you can't write INTERVAL types in yaml, so let's have users simply write strings and dbt-external-tables does the conversion (by adding quotes or not depending on the type on BigQuery) -> no need to worry about quoting or not in yaml. Also removing both the check and quotes will break backwards compatibility: every user will have to explicitly write quotes in yaml (and it's super painful since you need to escape quotes). IMO the added complexity is ok: it's not that huge, and allow users to do something that can't be done otherwise! |
edit: nope! that'll just skip it entirely |
@marcbllv Ok makes sense, we have an open discussion anyway to change the way how to set BigQuery options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🧙♂️
@jeremyyeo much needed feature, lets merge it 🥇 |
@dataders I saw you merge another pr, could you also take a look at this one? |
Description & motivation
resolves: #231
Option item
max_staleness
in BigQuery must be passed as an INTERVAL, not a string.But it's flagged as a string in YAML config.
Therefore compiled SQL code is:
while it should be:
Checklist