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

[Compatibility] Whitespace Errors while compiling int_zendesk__field_history_scd #105

Open
2 of 4 tasks
bcolbert978 opened this issue Jul 31, 2023 · 1 comment
Open
2 of 4 tasks
Labels
priority:p4 Affects few users; pick up when available status:in_review Currently in review type:enhancement New functionality or enhancement update_type:models Primary focus requires model updates

Comments

@bcolbert978
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

The int_zendesk__field_history_scd model file contains an interesting pattern at the top of the model:

  1. First, a standard SQL comment (using --)
  2. Next, the standard jinja config.
  3. Then, a jinja set command with whitespace controls ({%- -%})
  4. Finally, the SQL begins with the usual with statement.

Jinja whitespace parsing can cause unexpected issues when compiling to SQL. While this pattern appears to work as expected with dbt's current parsing engine, I've been testing an alternative parsing tool and am finding that the whitespace parsing is leading to the surprising result where the last word of the comment from (1) is being concatenated with the with from (4) resulting in valueswith which obviously causes the sql to fail.

Relevant error log or model output

No response

Expected behavior

While I understand that the team's objective is to build for today's dbt and not other parsing engines, I would still expect to avoid problematic jinja patterns, especially those that result from cosmetic choices like whitespace management. Simply flipping the set command to use {% %} instead should allow all jinja parsers to handle the script successfully.

dbt Project configurations

n/a

Package versions

latest:

version: [">=0.10.0", "<0.11.0"]

What database are you using dbt with?

bigquery

dbt Version

Core:

  • installed: 1.5.3
  • latest: 1.6.0 - Update available!

Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Plugins:

  • bigquery: 1.5.3 - Up to date!

Additional Context

No response

Are you willing to open a PR to help address this issue?

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.
@bcolbert978 bcolbert978 added the bug Something isn't working label Jul 31, 2023
@fivetran-joemarkiewicz
Copy link
Contributor

Hi @bcolbert978 thanks for opening this issue and providing a clear outline of the issue you are facing when running this model in the other parsing engine.

I agree that this is worthwhile to update in the package; however, I would argue that we don't classify this as a bug as the compiled code does work for the supported engine. I would instead label this as an enhancement to ensure it works on a different parsing engine other than dbt. This will not impact the speed at which the update is applied, but rather for future reference and tracking on our end to gauge package health in relation to created bugs. Let me know if you disagree.

With that being said, I am definitely open to including this update to provide better whitespace management within the package models. Can you confirm that this is the only model where this is type of error is occurring? I would want to make any other necessary adjustments when applying this fix so we can capture all the required whitespace corrections together.

Additionally, I see you are open to creating a PR! Let me know if you are still interested, I am happy to walk you through any steps 😄

@fivetran-joemarkiewicz fivetran-joemarkiewicz added priority:p4 Affects few users; pick up when available type:enhancement New functionality or enhancement status:in_review Currently in review update_type:models Primary focus requires model updates and removed bug Something isn't working labels Aug 2, 2023
@fivetran-joemarkiewicz fivetran-joemarkiewicz changed the title [Bug] Whitespace Errors while compiling int_zendesk__field_history_scd [Compatibility] Whitespace Errors while compiling int_zendesk__field_history_scd Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p4 Affects few users; pick up when available status:in_review Currently in review type:enhancement New functionality or enhancement update_type:models Primary focus requires model updates
Projects
None yet
Development

No branches or pull requests

2 participants