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_columns_in_relation_sql returns an error during parse phase on Snowflake when using a created Relation #14

Closed
clrcrl opened this issue Jan 21, 2020 · 2 comments
Labels

Comments

@clrcrl
Copy link
Contributor

clrcrl commented Jan 21, 2020

Offending code:

{% set old_etl_relation=adapter.get_relation(
      database=target.database,
      schema="ANALYTICS",
      identifier="DIM_ACCOUNTS"
) -%}
{{ audit_helper.get_columns_in_relation_sql(old_etl_relation) }}

Result:

Compilation Error in macro snowflake__get_columns_in_relation_sql (macros/compare_relation_columns.sql)
  'None' has no attribute 'information_schema'
  > in macro adapter_macro (macros/adapters/common.sql)
  > called by macro get_columns_in_relation_sql (macros/compare_relation_columns.sql)
  > called by macro compare_relation_columns (macros/compare_relation_columns.sql)
  > called by macro snowflake__get_columns_in_relation_sql (macros/compare_relation_columns.sql)

Workaround:
Wrap everything in an {% if execute %} statement

Investigation:
I believe this is because I call {{ relation.information_schema('columns') }}, but during the parse-phase I haven't yet created the relation

Likely happening on BQ and Postgres too

@github-actions
Copy link

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jul 20, 2023
@github-actions
Copy link

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant