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]: Raw reflection config options throws 'dict object' has no attribute 'CompilationError' #190

Open
1 task done
wilso opened this issue Jun 28, 2023 · 5 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@wilso
Copy link

wilso commented Jun 28, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When adding {{ config(materialized = 'reflection', reflection_type = 'raw') }} to the top of a sql model to try and configure a raw reflection on a VDS the following error is thrown:

20:04:56 Compilation Error in model my_second_dbt_model (models/example/my_second_dbt_model.sql)
20:04:56 'dict object' has no attribute 'CompilationError'

I'm able to reproduce this with our internal dbt repo and with the example models from dbt init.

Expected Behavior

Reflection gets created on VDS.

Steps To Reproduce

  1. Create new dbt project with dbt init
  2. dbt run to apply example models
  3. Add {{ config(materialized = 'reflection', reflection_type = 'raw') }} to the top of models/example/my_second_dbt_model.sql.
  4. dbt run will throw error:

20:18:18 Compilation Error in model my_second_dbt_model (models/example/my_second_dbt_model.sql)
20:18:18 'dict object' has no attribute 'CompilationError'

Environment

- OS: macOS Big Sur 11.7.7
- dbt-dremio: 1.4.5, 1.5.0
- Dremio Software: 23.1.40(AWS Edition), 24.1.0(Community Edition)
- Dremio Cloud: N/A

Relevant log output

20:18:17  Running with dbt=1.4.5
20:18:17  Found 2 models, 4 tests, 0 snapshots, 0 analyses, 333 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics
20:18:17
20:18:18  Concurrency: 4 threads (target='dbt-dremio')
20:18:18
20:18:18  1 of 2 START sql table model $scratch.my_first_dbt_model ....................... [RUN]
20:18:18  1 of 2 OK created sql table model $scratch.my_first_dbt_model .................. [2 in 0.55s]
20:18:18  2 of 2 START sql reflection model my_second_dbt_model .......................... [RUN]
20:18:18  2 of 2 ERROR creating sql reflection model my_second_dbt_model ................. [ERROR in 0.05s]
20:18:18
20:18:18  Finished running 1 table model, 1 reflection model in 0 hours 0 minutes and 1.38 seconds (1.38s).
20:18:18
20:18:18  Completed with 1 error and 0 warnings:
20:18:18
20:18:18  Compilation Error in model my_second_dbt_model (models/example/my_second_dbt_model.sql)
20:18:18    'dict object' has no attribute 'CompilationError'
20:18:18
20:18:18  Done. PASS=1 WARN=0 ERROR=1 SKIP=0 TOTAL=2
@wilso
Copy link
Author

wilso commented Jun 30, 2023

It looks like this works with dbt-core==1.3.2 and dbt-dremio==1.3.2 but not with any newer version of dbt-core or dbt-dremio.

@donatobarone
Copy link

I get the exact same error. I have dbt-core 1.5.2 and 1.5.0

@donatobarone
Copy link

Okay I got a bit further here, in order to create the reflection theoretically, but I might be wrong :D you would have to create a separate model which the only macro is calling is the one you have, but you will have to specify the dependency from the original view model using the --depends_on comment, as explained in the wiki https://github.com/dremio/dbt-dremio/wiki/Using-Materializations-with-Dremio#configuring-reflections. Maybe they have changed the workflow to create reflections. Still that failed, because either I am doing something wrong or the macro has a bug. Will create a ticket for it.

@ravjotbrar
Copy link
Contributor

Apologies for the delayed response. What happens if you add this to the bottom of your dbt_project.yml file:

vars:
  dremio:reflections_enabled: true

@mxmarg
Copy link
Contributor

mxmarg commented Feb 1, 2024

Setting vars seems to solve the issue in my case.
Can we maybe add a more descriptive error message and better documentation in the wiki around the importance of setting this flag in the project.yml?

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

No branches or pull requests

4 participants