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

get_column_values macro causes the compiler to run infinitely if the table references is materialized as ephemeral #358

Closed
heysweet opened this issue May 3, 2021 · 3 comments
Labels
bug Something isn't working triage

Comments

@heysweet
Copy link

heysweet commented May 3, 2021

Describe the bug

From the user, using the Cloud IDE:

I think that the problem is actually with dbt_utils package and get_column_values
macro. I tried to compile models that have that macro and they don't error, but
they just leave the compiler to run forever
After further investigation, I think that the macro causes compiler to run infinitely
if the table referenced is materialized as ephemeral

...
I found a way. to make it work now that I changed the referenced
table to be materialized as view

Steps to reproduce

I actually don't have enough context to fully know repro steps, but presumably start by trying to use the get_column_values macro on a table materialized as ephemeral.

Expected results

A table materialized as ephemeral should likely produce the same results as a table that is materialized as a view, or we should error out immediately to let users know this configuration is not valid.

Actual results

User saw an infinite spinner.

Are you interested in contributing the fix?

I could try, but I'm just on support rotation and trying to file this bug to people who have more context.

@heysweet heysweet added bug Something isn't working triage labels May 3, 2021
@heysweet
Copy link
Author

heysweet commented May 3, 2021

After talking to @jtcohen6 it appears that dbt_utils.get_column_values is not meant to work with ephemeral models. Similar macros throw errors, and this one doesn't appear to currently! The likely fix is to throw an error when trying to use dbt_utils.get_column_values is not meant to work with ephemeral models with ephemeral models.

@jtcohen6
Copy link
Contributor

jtcohen6 commented May 3, 2021

I don't know exactly why the infinite spinner happened (some weird product of statement + RPC + IDE?), but the short answer here is that dbt_utils.get_column_values should use the _is_ephemeral check to raise an exception if the table argument is an ephemeral model. Similar to other macros that do this today:

https://github.com/fishtown-analytics/dbt-utils/blob/489a44bb7ebad1a6d9ba762fdcd7dc6a9fea7e0d/macros/schema_tests/equality.sql#L23
https://github.com/fishtown-analytics/dbt-utils/blob/489a44bb7ebad1a6d9ba762fdcd7dc6a9fea7e0d/macros/sql/star.sql#L7

@dbeatty10
Copy link
Contributor

I believe this is resolved by #518 🤞

Please let me know if that is not the case and I will re-open this.

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

No branches or pull requests

3 participants