dbt-labs / dbt-snowflake

dbt-snowflake contains all of the code enabling dbt to work with Snowflake
https://getdbt.com
Apache License 2.0
296 stars 176 forks source link

Change how a column of type VECTOR is parsed #1169

Open achawkins opened 3 months ago

achawkins commented 3 months ago

resolves #1098 docs dbt-labs/docs.getdbt.com/#

Problem

When an incremental (maybe other materializations, but I have not checked) model with a VECTOR type is run, it will fail to create the SnowflakeColumn object from the from_description class method. This is because the dbt-adapters Column.from_description method does some parsing to extract the precision and scale of a numeric type and tries to cast both values within parenthesis to integers. The Snowflake vector is of the form VECTOR(<data_type>, <dimension>), so the <data_type> will fail to be cast as an integer.

Solution

If the data type has the word VECTOR in it, bypass the additional parsing done in dbt-adapters and return a SnowflakeColumn that uses the raw data type as the parsed data type. If it does not, then pass it through to the default from_description method.

Checklist

cla-bot[bot] commented 3 months ago

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Andrew Hawkins. This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
cla-bot[bot] commented 1 month ago

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Andrew Hawkins. This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
colin-rogers-dbt commented 1 month ago

@achawkins this looks pretty merge-able, are you able to sign our CLA and add a changelog?

cla-bot[bot] commented 1 month ago

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Andrew Hawkins. This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
achawkins commented 1 month ago

@colin-rogers-dbt I must have signed the CLA with a different email before. I resigned it and added the changelog entry.

colin-rogers-dbt commented 1 month ago

@cla-bot check

cla-bot[bot] commented 1 month ago

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Andrew Hawkins. This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
cla-bot[bot] commented 1 month ago

The cla-bot has been summoned, and re-checked this pull request!

liorchen commented 1 month ago

can this be merged? blocking us from moving forward

ChenVilinsky commented 1 week ago

Is there any update on this PR status? It's a real blocker...