Open dataders opened 5 months ago
@dataders are you still seeing this issue in dbt 1.7 or 1.8?
I wasn't able to reproduce this with Python 3.10.10 and the same versions of dbt-core and dbt-snowflake as you -- here's what I got instead:
(dbt_1.7) $ dbt show --inline "SLECT 1 as my_col"
23:20:10 Running with dbt=1.7.11
23:20:12 Registered adapter: snowflake=1.7.3
23:20:12 Found 1 model, 1 seed, 0 sources, 0 exposures, 0 metrics, 430 macros, 0 groups, 0 semantic models
23:20:12
23:20:13 Concurrency: 10 threads (target='snowflake')
23:20:13
23:20:14 Encountered an error:
Runtime Error
Database Error in sql_operation inline_query (from remote system.sql)
001003 (42000): SQL compilation error:
syntax error line 3 at position 8 unexpected 'SLECT'.
(dbt_1.7) $
Describe the feature
I'm noticing that #8166 is happening again on
dbt-core==1.7.11
with multiple adapters.If as user calls
dbt show
on a model or inline-query that the underlying data platform does not like, dbt should quit and return the database error. Instead, show continues, which results in an stack trace resulting from dbt trying to callAgate.Table.print_table()
on aNone
.The undesirable behavior is consistent across both the
--inline
and-s some_model
usage patterns.Reproducible Example
input
output
Describe alternatives you've considered
Perhaps there's a
try-catch
that if there's a database error and noResultSet
is returned, thendbt show
can return/print an empty Agate table? or even a table with the database error in it?Who will this benefit?
All users of
dbt show
as well as users of downstream tools that make use of the same.Are you interested in contributing this feature?
No response
Anything else?
No response