Datavault-UK / automate-dv

A free to use dbt package for creating and loading Data Vault 2.0 compliant Data Warehouses (powered by dbt, an open source data engineering tool, registered trademark of dbt Labs)
https://www.automate-dv.com
Apache License 2.0
478 stars 114 forks source link

[BUG] <my bug title> #190

Closed VoRCeK closed 1 year ago

VoRCeK commented 1 year ago

Describe the bug In the link.sql macro for Snowflake, the final comma (",") in row 48 & 50 is causing the compiled SQL to fail for having that extra comma before the FROM selection in the statement.

The entire string, including commas, are being created by the dbtvault.prefix macro (which is working fine). Everywhere else this dbtvault.prefix is used, there is no final comma in the line. Examples: Rows 53, 54, 96, 97 & 107

Environment

dbt version: 1.4.4 dbtvault version: Database/Platform:

To Reproduce Steps to reproduce the behavior:

  1. Create a LINK table following this documentation: https://dbtvault.readthedocs.io/en/latest/macros/#link
  2. generate SQL with dbt compile --select <your_model>
  3. Scroll down to Row 12 in the compiled code
  4. See the extra comma

Expected behavior This extra comma would not be in the compiled code.

DVAlexHiggs commented 1 year ago

Hi! Thanks for your report.

Can you provide the dbtvault version please and provide your model code. This is not happening in our tests and is a very fundamental issue, so I believe it may be to do with your configuration. If not, we probably need to improve the error handling!

Thanks

DVAlexHiggs commented 1 year ago

@VoRCeK Hi! I assume this was closed because you found the issue. Can you explain what it was please? We'd like to add in error handling and an error message for what happened if it wasn't obvious to you!

Thanks :)