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

Adding column data types to cleanup_exceptions #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JacobJuulPedersen
Copy link

Important

Don't expose any internal or business critical information to this public repository!

Why?

When building a project with the dna_public_dbt_macros package installed, a cleanup_exceptions table is built with all columns given the data type 'NUMBER(38,0)'.
If a user later wants to use the cleanup_exceptions, the build will fail with the following error:

Database Error in seed cleanup_exceptions (seeds/cleanup_exceptions.csv)
  100038 (22018): Numeric value 'VIEW' is not recognized

We tried to use the cleanup_exceptions in the Tech Buying project, to clean up tables without deleting a view created outside dbt.
We were unable to build the cleanup_exceptions until we dropped the existing table.

What?

The added code sets the column types to varchar, in order to avoid the above error.

This fix will work for projects that do not already have the dna_public_dbt_macros package installed.

Test

I have tested the changes.
If the table is not already built, it will be built with the correct data types.
If the table is built with the wrong data types, nothing will happen.

Breaking Change?

N
The project will build without problems.

PLEASE NOTE:
If cleanup_exceptions values are added in a project with an existing empty cleanup_exceptions table of the current version, the build will fail. The existing cleanup_exceptions will then need to be dropped, before the project will build.
If an empty cleanup_exceptions table of the current version does not exist in the project, this change will make sure that an empty table is built with the correct data types, so it will be usable when needed.

I have not been able to change the data types, without dropping the existing table - Is it possible?

@JacobJuulPedersen JacobJuulPedersen requested a review from a team as a code owner February 3, 2025 09:45
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

Successfully merging this pull request may close these issues.

1 participant