You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is similar to the resolved issue with dbt_utils.star() here: #605. I have a model using union_relations, that references tables that haven't been built yet. I want to be able to run SQLFluff and lint my model, but I get Found unparsable section: 'select'.
Steps to reproduce
Create two upstream models:
# model1.sql
SELECT 1 AS model1_column
# model2.sql
SELECT 1 AS model2_column
Create the model that uses union_relation. Important you pass source_column_name=None, to trigger the parse error with SQLFluff:
Core:
- installed: 1.5.1
- latest: 1.6.1 - Update available!
Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
Plugins:
- bigquery: 1.5.1 - Update available!
At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
Additional context
Using sqlfluff version 2.3.1, with the same version sqlfluff-templater-dbt.
Are you interested in contributing the fix?
A snippet like this in the default macro, maybe?
/* No columns from any of the relations.
This star is only output during dbt compile, and exists to keep SQLFluff happy. */
{% if dbt_command == 'compile' and ordered_column_names|length == 0 %}
*
{% endif %}
Not sure what integration tests would be appropriate, since it's for flags.WHICH == compile.
The text was updated successfully, but these errors were encountered:
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.
Describe the bug
I think this is similar to the resolved issue with
dbt_utils.star()
here: #605. I have a model usingunion_relations
, that references tables that haven't been built yet. I want to be able to run SQLFluff and lint my model, but I getFound unparsable section: 'select'
.Steps to reproduce
union_relation
. Important you passsource_column_name=None
, to trigger the parse error with SQLFluff:sqlfluff lint
againstmodel3.sql
.Expected results
I'd expect the compiled SQL to have
*
in the SELECT statement, similar to how it's handled with thedbt_utils.star
macro.Actual results
I don't get any text after the SELECT keyword, resulting in a parse error with SQLFluff.
Screenshots and log output
I get:
with the compiled SQL looking like this:
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:Additional context
Using
sqlfluff
version2.3.1
, with the same versionsqlfluff-templater-dbt
.Are you interested in contributing the fix?
A snippet like this in the default macro, maybe?
Not sure what integration tests would be appropriate, since it's for
flags.WHICH == compile
.The text was updated successfully, but these errors were encountered: