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
Default value is not used when sql statement of get_single_value macro do not return any result
Steps to reproduce
Sql statement on empty table or whatever query that do not return any result
Expected results
get_single_value macro should return default parameter when query is not returning a single value
Actual results
get_single_value macro return None as a result
Screenshots and log output
System information
The contents of your packages.yml file:
package: dbt-labs/dbt_utils
version: 1.0.0
Which database are you using dbt with?
postgres
redshift
[ x] bigquery
snowflake
other (specify: ____________)
The output of dbt --version:
Core:
- installed: 1.3.0
- latest: 1.5.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.3.0 - Update available!
Additional context
I think line 18: {% if r | length == 0 %}
could be replaced with
{% if not r[0] %} (or maybe {% if not (r and r[0]) %} )
because r has a value even if query has no result
Are you interested in contributing the fix?
The text was updated successfully, but these errors were encountered:
Le 1 nov. 2023 à 22:59, tsafacjo ***@***.***> a écrit :
can I take it ?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
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
Default value is not used when sql statement of get_single_value macro do not return any result
Steps to reproduce
Sql statement on empty table or whatever query that do not return any result
Expected results
get_single_value macro should return default parameter when query is not returning a single value
Actual results
get_single_value macro return None as a result
Screenshots and log output
System information
The contents of your
packages.yml
file:version: 1.0.0
Which database are you using dbt with?
The output of
dbt --version
:Additional context
I think line 18: {% if r | length == 0 %}
could be replaced with
{% if not r[0] %} (or maybe {% if not (r and r[0]) %} )
because r has a value even if query has no result
Are you interested in contributing the fix?
The text was updated successfully, but these errors were encountered: