Skip to content
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

[Bug] For BigQuery, a multiline string needs to be escaped with 3 quotes instead of 1 like in default__string_literal() #1088

Closed
2 tasks done
b-per opened this issue Feb 5, 2024 · 0 comments · Fixed by #1089
Labels
bug Something isn't working

Comments

@b-per
Copy link
Contributor

b-per commented Feb 5, 2024

Is this a new bug in dbt-bigquery?

  • I believe this is a new bug in dbt-bigquery
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

dbt.string_literal(val) is defined in dbt-adapters but not overwritten in dbt-bigquery.

Calling dbt.string_literal(val) fails in BigQuery when val contains newline characters. This is because strings with newlines characters need to be "triple-escaped" in BigQuery (docs)

Expected Behavior

Calling dbt.string_literal(val) in BigQuery should work with a val containing newlines

Steps To Reproduce

Create a model with

select {{ dbt.string_literal('my multiline 
string') }} as test

Relevant log output

No response

Environment

No response

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants