dbt-labs / dbt-adapters

Apache License 2.0
25 stars 35 forks source link

[Bug] Is the '`' symbol in the log the expected result? #196

Open peter-huang-xfers opened 5 months ago

peter-huang-xfers commented 5 months ago

Is this a new bug in dbt-core?

Current Behavior

04:26:08  1 of 1 START sql table model sta_datamart_dev.pma_segmentation_v3 .............. [RUN]
04:26:12  Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: ['gmv_d90_transfer', 'revenue_d90_transfer']`

Is the '`' symbol in the end of the log the expected result?

Expected Behavior

04:26:08  1 of 1 START sql table model sta_datamart_dev.pma_segmentation_v3 .............. [RUN]
04:26:12  Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: ['gmv_d90_transfer', 'revenue_d90_transfer']

Steps To Reproduce

I'm using BigQuery, and the issue can be reproduced by creating a table without assigning precision and scale to the numeric data type column.

Relevant log output

No response

Environment

- OS:
- Python:
- dbt-core: 1.7.13
- dbt-bigquery: 1.7.7

Which database adapter are you using with dbt?

bigquery

Additional Context

No response

dbeatty10 commented 5 months ago

Thanks for noticing this and reaching out @peter-huang-xfers !

This looks like it was unintentional or vestigial to me. But it also seems like it isn't causing any harm -- just a rogue extra character -- does that sound right?

Regardless, it seems like the fix would be easy, just remove the ~ "`" part from here:

https://github.com/dbt-labs/dbt-adapters/blob/df393ae6ae62e459c7b08dc2ce6e64a4c9d315cd/dbt/include/global_project/macros/adapters/columns.sql#L61

I would expect these two test cases to still pass after that change: