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] persist_docs does not work for materialized_view materializations #120

Closed
2 tasks done
morsapaes opened this issue Jun 26, 2024 · 2 comments · Fixed by #98
Closed
2 tasks done

[Bug] persist_docs does not work for materialized_view materializations #120

morsapaes opened this issue Jun 26, 2024 · 2 comments · Fixed by #98
Labels
bug Something isn't working triage

Comments

@morsapaes
Copy link
Contributor

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

The macro that backs object-level persist_docs uses {{ relation.type }} to derive the object type in the COMMENT ON statement. This breaks for materialized_view materializations:

15:35:01  Database Error in model funds_movement (models/marts/funds_movement.sql)
15:35:01    Expected one of TABLE or VIEW or COLUMN or MATERIALIZED or SOURCE or SINK or INDEX or FUNCTION or CONNECTION or TYPE or SECRET or ROLE or DATABASE or SCHEMA or CLUSTER, found identifier "materialized_view"
15:35:01    LINE 5:   comment on materialized_view "marta"."public"."funds_moveme...
15:35:01                         ^
15:35:01    compiled Code at target/run/mz_get_started/models/marts/funds_movement.sql
15:35:01
15:35:01  Done. PASS=3 WARN=0 ERROR=2 SKIP=0 TOTAL=5

Expected Behavior

The persist_docs config should work for materialized_view materializations.

Steps To Reproduce

Attempt to use the persist_docs config with a materialized view model.

Relevant log output

No response

Environment

No response

Additional Context

We've fixed this a while back for dbt-materialize (which shims dbt-postgres) in Materialize #21878, but it really should be fixed at the source! This issue was also reported by a user of the dbt-risingwave adapter (dbt-risingwave #31), which also shims dbt-postgres.

@jeremyyeo
Copy link

Previously reported #11

@morsapaes
Copy link
Contributor Author

Oh, sorry I missed that issue. Thank you, @jeremyyeo!

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

Successfully merging a pull request may close this issue.

2 participants