dbt-labs / dbt-redshift

dbt-redshift contains all of the code enabling dbt to work with Amazon Redshift

Home Page:https://getdbt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Regression] 'RedshiftRelation' object has no attribute 'lower'

Olaktal opened this issue · comments

Is this a regression in a recent version of dbt-redshift?

  • I believe this is a regression in dbt-redshift functionality
  • I have searched the existing issues, and I could not find an existing issue for this regression

Current Behavior

Hello

I'm facing following error for table materialization only (incremental & views are fine) since dbt-version 1.6.0 but I'm not able to understand which change is behind this, reading the release :(

As a prof, I executed the same model with dbt 1.5.9 (working perfectly) and then 1.6.0 (not working)

▶ REDSHIFT_SCHEMA=analytics_model poetry run dbt --no-write-json run --models rel_identity_workspace --vars '{"environment": "staging"}' --no-version-check
16:34:23  Running with dbt=1.5.9
16:34:23  Registered adapter: redshift=1.5.9
16:34:23  Unable to do partial parsing because of a version mismatch
16:34:26  Found 199 models, 181 tests, 0 snapshots, 0 analyses, 661 macros, 0 operations, 64 seed files, 94 sources, 0 exposures, 0 metrics, 0 groups
16:34:26  
16:34:31  Concurrency: 4 threads (target='staging')
16:34:31  
16:34:31  1 of 1 START sql table model analytics_model.rel_identity_workspace ............ [RUN]
16:34:34  1 of 1 OK created sql table model analytics_model.rel_identity_workspace ....... [SUCCESS in 3.78s]
16:34:35  
16:34:35  Finished running 1 table model in 0 hours 0 minutes and 8.99 seconds (8.99s).
16:34:35  
16:34:35  Completed successfully
16:34:35  
16:34:35  Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1
(data-engineering) 
queries/dbt/models  CDATA-196-UpdateAirflow ✗                                         1d3h ✖ ▴ ⚑ ◒  
▶ poetry run dbt --version
Core:
  - installed: 1.5.9 
  - latest:    1.7.10 - 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:
  - redshift: 1.5.9 - Update available!
  - postgres: 1.5.9 - Update available!

  At least one plugin is out of date or incompatible with dbt-core.
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation


(data-engineering) 
queries/dbt/models  CDATA-196-UpdateAirflow ✗                                         1d3h ✖ ▴ ⚑ ◒  
▶ poetry add dbt-redshift==1.6.0 dbt-core==1.6.0

Updating dependencies
Resolving dependencies... (8.6s)

Package operations: 2 installs, 4 updates, 0 removals

  • Installing more-itertools (8.14.0)
  • Installing dbt-semantic-interfaces (0.2.3)
  • Updating mashumaro (3.6 -> 3.8.1)
  • Updating dbt-core (1.5.9 -> 1.6.0)
  • Updating dbt-postgres (1.5.9 -> 1.6.0)
  • Updating dbt-redshift (1.5.9 -> 1.6.0)

Writing lock file
(data-engineering) 
queries/dbt/models  CDATA-196-UpdateAirflow ✗                                         1d3h ✖ ▴ ⚑ ◒  
▶ REDSHIFT_SCHEMA=analytics_model poetry run dbt --no-write-json run --models rel_identity_workspace --vars '{"environment": "staging"}' --no-version-check
16:36:17  Running with dbt=1.6.0
16:36:17  Registered adapter: redshift=1.6.0
16:36:17  Unable to do partial parsing because of a version mismatch
16:36:20  Found 199 models, 64 seeds, 181 tests, 94 sources, 0 exposures, 0 metrics, 709 macros, 0 groups, 0 semantic models
16:36:20  
16:36:26  Concurrency: 4 threads (target='staging')
16:36:26  
16:36:26  1 of 1 START sql table model analytics_model.rel_identity_workspace ............ [RUN]
16:36:28  1 of 1 ERROR creating sql table model analytics_model.rel_identity_workspace ... [ERROR in 2.28s]
16:36:29  
16:36:29  Finished running 1 table model in 0 hours 0 minutes and 8.79 seconds (8.79s).
16:36:29  
16:36:29  Completed with 1 error and 0 warnings:
16:36:29  
16:36:29  Runtime Error in model rel_identity_workspace (models/tmp/rel_identity_workspace.sql)
16:36:29    'RedshiftRelation' object has no attribute 'lower'
16:36:29  
16:36:29  Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1
(data-engineering) 
(data-engineering) 
queries/dbt/models  CDATA-196-UpdateAirflow ✗                                        1d3h ✖ ▴ ⚑ ◒  ⍉
▶ REDSHIFT_SCHEMA=analytics_model poetry run dbt run --models rel_identity_workspace 
16:41:58  Running with dbt=1.6.0
16:41:58  Registered adapter: redshift=1.6.0
16:41:58  Unable to do partial parsing because config vars, config profile, or config target have changed
16:42:01  Found 199 models, 64 seeds, 181 tests, 94 sources, 0 exposures, 0 metrics, 709 macros, 0 groups, 0 semantic models
16:42:01  
16:42:04  Concurrency: 4 threads (target='staging')
16:42:04  
16:42:04  1 of 1 START sql table model analytics_model.rel_identity_workspace ............ [RUN]
16:42:05  1 of 1 ERROR creating sql table model analytics_model.rel_identity_workspace ... [ERROR in 0.85s]
16:42:06  
16:42:06  Finished running 1 table model in 0 hours 0 minutes and 5.07 seconds (5.07s).
16:42:06  
16:42:06  Completed with 1 error and 0 warnings:
16:42:06  
16:42:06  Runtime Error in model rel_identity_workspace (models/tmp/rel_identity_workspace.sql)
16:42:06    'RedshiftRelation' object has no attribute 'lower'
16:42:06  
16:42:06  Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1

Any idea why ? It doesn't seem any other library are updated when I updated dbt to 1.6.0 so it make me think it's only related to dbt 🤔

Expected/Previous Behavior

I would expect the run to build the table as shown in the first run with dbt 1.5.9

Steps To Reproduce

cf terminal command above

Relevant log output

No response

Environment

- OS: Mac Os Sonoma 14.3 (23D56)
- Python: 3.11.3
- dbt-core (working version): 1.5.9
- dbt-redshift (working version): 1.5.9
- dbt-core (regression version): 1.6.0
- dbt-redshift (regression version): 1.6.0

Additional Context

No response

Hello
Any news about this error ?
Is it linked to package dbt-redshift or is it dbt-core related ?
Thanks !