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] Syntax for derived columns in stage macro changed #326

Open
OGrohmann opened this issue Feb 21, 2025 · 1 comment
Open

[BUG] Syntax for derived columns in stage macro changed #326

OGrohmann opened this issue Feb 21, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@OGrohmann
Copy link

Describe the bug

We are currently using datavault4dbt version 1.4.2 and want to upgrade to the latest version. Unfortunately the build of our stage models is failing with the latest version as the definition of our derived columns is not supported anymore.

Please adapt the macro in a way that the old definition of derived columns is still working, thanks!

Environment

  • dbt version: cloud version "latest"
  • datavault4dbt version: latest
  • Database/Platform: Snowflake

To Reproduce

Example:

We are using following syntax in the derived columns section of the stage models to define constants and hard rules:

derived_columns:
SOURCE_SYSTEM: "!MY_SYSTEM"
DOCUMENT_ID: "LTRIM(DOKNR,0)"

This syntax does not work anymore and has to be changed to following:

derived_columns:
SOURCE_SYSTEM:
VALUE: "!MY_SYSTEM"
DATATYPE: "VARCHAR"
DOCUMENT_ID:
VALUE: "LTRIM(DOKNR,0)"
DATATYPE: "VARCHAR"

Expected behavior

Example:

The following stage syntax for derived columns should successfully be compiled and executed.

derived_columns:
SOURCE_SYSTEM: "!MY_SYSTEM"
DOCUMENT_ID: "LTRIM(DOKNR,0)"

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

@OGrohmann OGrohmann added the bug Something isn't working label Feb 21, 2025
@tkirschke
Copy link
Member

Hi @OGrohmann and thanks for reaching out!

Sorry to hear that the new version breaks your existing syntax for derived columns. However, the syntax that you use right now was never intended by the derived_columns macro and only worked by chance.

This commit fixed some bugs with the derived columns, and since this commit your syntax should no longer work.

I am afraid that you need to update your syntax to be able to use the latest version of datavault4dbt..

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

No branches or pull requests

2 participants