Skip to content
New issue

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

mySQL warnings treated as errors #177

Open
kzajaczkowski opened this issue Nov 23, 2024 · 0 comments
Open

mySQL warnings treated as errors #177

kzajaczkowski opened this issue Nov 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kzajaczkowski
Copy link
Contributor

Describe the bug

If a model SQL query gets warning from mysql engine. The dbt model processing fails with error instead of succeeding with warning.

Steps To Reproduce

Create the following model named stg_test.

{{
  config(
    materialized = "table"
  )
}}

SELECT STR_TO_DATE(
           'Just a dummy string',
            '%d/%m/%y %h:%i %p'
        ) AS col1

Run

dbt run --select stg_test

You will get the following error

Database Error in model stg_test (***/stg_test.sql)
  1411 (HY000): Incorrect datetime value: 'Just a dummy string' for function str_to_date
  compiled Code at target/run/***/stg_test.sql

When you run the same query in mysql, it succeeds and gives just a warning.

Expected behavior

I would expect the model to return success with warning if mysql runs the query successfully.

Screenshots and log output

image

The output of dbt --version:

Core:
  - installed: 1.7.17
  - latest:    1.8.9  - 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:
  - mysql:   1.7.0 - Up to date!
  - mysql5:  1.7.0 - Could not determine latest version
  - mariadb: 1.7.0 - Could not determine latest version

The operating system you're using:
macOS / docker

The output of python --version:
Python 3.11.9

Additional context

I am not sure if this is a bug or by design, but wasn't able to find any documentation on it.

@kzajaczkowski kzajaczkowski added the bug Something isn't working label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant