We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Printing the results does not work when the databricks schema contains special characters
using special characters in your schema: for example ch-123
ch-123
the expected behaviour = printing the results
on-run-end failed, error:
[INVALID_IDENTIFIER] The identifier ch-51278 is invalid. Please, consider quoting it with back-quotes as ch-51278.(line 4, pos 28) == SQL == /* {"app": "dbt", "dbt_version": "1.7.3", "dbt_databricks_version": "1.7.2", "databricks_sql_connector_version": "2.9.3", "profile_name": "user", "target_name": "qas", "connection_name": "master"} */
ch-51278
select * from qas.ch-51278.fct_test_coverage
----------------------------^^^
The contents of your packages.yml file: packages:
packages.yml
Which database are you using dbt with?
The output of dbt --version: Running with dbt=1.7.3 Registered adapter: databricks=1.7.2
dbt --version
dbt_project_evaluator > macros > on-run-end > print_dbt_project_evaluator_issues set db_schema: quote a lowercase the three level namespace
The text was updated successfully, but these errors were encountered:
Hi @bram-83 , thanks for raising this.
As we don't use ref in the current code, it doesn't take in account the quoting config that might be set in dbt_project.yml.
ref
quoting
dbt_project.yml
What I would recommend is doing a copy of the macro and changing this line from
{% set model_schema = model_details.schema %}
to
{% set model_schema = "`" ~ model_details.schema ~ "`" %}
You can then update you on-run-end to point to your own macro instead of the package one.
on-run-end
If this works, we could update the macro in the package and add an optional parameter to add quoting.
Let me know how it goes.
Sorry, something went wrong.
Hi @b-per, Thank you for the tip. I quoted the schema & catalog name. I't working fine now, thanks,
When we do a new release you will be able to use print_dbt_project_evaluator_issues(quote='`')
print_dbt_project_evaluator_issues(quote='`')
Successfully merging a pull request may close this issue.
Describe the bug
Printing the results does not work when the databricks schema contains special characters
Steps to reproduce
using special characters in your schema: for example
ch-123
Expected results
the expected behaviour = printing the results
Actual results
on-run-end failed, error:
[INVALID_IDENTIFIER] The identifier ch-51278 is invalid. Please, consider quoting it with back-quotes as
ch-51278
.(line 4, pos 28)== SQL ==
/* {"app": "dbt", "dbt_version": "1.7.3", "dbt_databricks_version": "1.7.2", "databricks_sql_connector_version": "2.9.3", "profile_name": "user", "target_name": "qas", "connection_name": "master"} */
----------------------------^^^
Screenshots and log output
System information
The contents of your
packages.yml
file:packages:
version: 0.8.7
version: [">=1.0.0", "<2.0.0"]
version: 0.8.0
Which database are you using dbt with?
The output of
dbt --version
:Running with dbt=1.7.3
Registered adapter: databricks=1.7.2
Additional context
dbt_project_evaluator > macros > on-run-end > print_dbt_project_evaluator_issues
set db_schema: quote a lowercase the three level namespace
The text was updated successfully, but these errors were encountered: