Closed boblannon-fp closed 1 year ago
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.
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.
Can we reopen this, as Im facing the same issue.
Can we reopen this please?
Describe the bug
When attempting to generate a source, an opaque error is generated. I've confirmed that the
SELECT ... FROM INFORMATION_SCHEMA
query does in fact return results, but the macro still fails.Steps to reproduce
Expected results
Generated sources.yml output
Actual results
Python runtime error:
Screenshots and log output
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using: Working in a docker container, using base image
python:3.9-slim
The output of
python --version
:Additional context
The problem seems to be here, in
dbt_utils
macroget_relations_by_pattern
.https://github.com/dbt-labs/dbt-utils/blob/064c2abee80816ea855de32e66e54e96d9916677/macros/sql/get_relations_by_pattern.sql#L18-L23
The columns in the query result are named correctly, but they're returned in all caps. If I change those lines to the following, then the command works as expected.
I'm not 100% sure where a change needs to be made, it's possible that it's actually
get_tables_by_pattern_sql.sql
that needs to be changed. I'm not sure whether it's possible to force snowflake to return results with the correct case. I would have expected snowflake to use the quoted column aliases in the query, which are lower...Are you interested in contributing the fix?
I probably won't have time any time soon.