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

cube_dbt does not handle all dbt model contract data types from Snowflake #9

Open
jmkacz opened this issue Oct 19, 2024 · 2 comments
Open

Comments

@jmkacz
Copy link
Contributor

jmkacz commented Oct 19, 2024

Looking at https://github.com/cube-js/cube_dbt/blob/main/src/cube_dbt/column.py#L29-L45, cube_dbt only maps a handful of types to cube.dev's five (5) supported dimension types (https://cube.dev/docs/reference/data-model/types-and-formats#dimension-types).

The documentation on cube.dev's site states that there are only a few supported types, but not why only those.

Column types should match dimension types or a few supported aliases:
-- https://cube.dev/docs/reference/python/cube_dbt

We are using Snowflake, dbt, cube.dev, and cube_dbt.

The following contract snippet builds successfully in dbt IDE, but our developers want to be more specific (ex. data_type: timestamp_ntz) and :

      - name: last_modified_at_utc
        description: >
          {{ doc("last_modified_at_utc") }}
        data_type: timestamp

We then get the following error:

Unknown column type of <MODEL>.<COLUMN>: timestamp_ntz

from this line of code: https://github.com/cube-js/cube_dbt/blob/main/src/cube_dbt/column.py#L47

@jmkacz
Copy link
Contributor Author

jmkacz commented Oct 19, 2024

I have a PR I would like to file that covers all existing Snowflake data types in the type mapping dict.

@jmkacz
Copy link
Contributor Author

jmkacz commented Oct 25, 2024

Here are my proposed changes: #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant