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

Debug log when type_code fails to convert to a data_type #135

Merged
merged 6 commits into from
Apr 12, 2024

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Mar 24, 2024

resolves #134

Problem

For any given adapter, it's possible that dbt doesn't recognize a data type specified in a dbt model contract. An example is dbt-labs/dbt-postgres#54

In those cases, we want there to be a mechanism for the dbt adapter to emit a log message of what's going on.

Solution

Emit a debug-level log message any time a data type is not recognized within dbt-postgres. That way, users can at least see in the logs what is going on.

Log messages will look like the following:

The type_code 790 was not recognized

An example of how to utilize this log message is within dbt-labs/dbt-postgres#39

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development, and it appears to resolve the stated issue
  • This PR includes tests
  • This PR has already received feedback and approval from Product or DX

@dbeatty10 dbeatty10 marked this pull request as ready for review April 12, 2024 14:11
mikealfare
mikealfare previously approved these changes Apr 12, 2024
Copy link
Contributor

@mikealfare mikealfare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only noticed one thing, which is aesthetic. I'm not super familiar with protobuf, but this change looks consistent with the others.

dbt/adapters/events/types.py Show resolved Hide resolved
@dbeatty10 dbeatty10 merged commit 67315c7 into main Apr 12, 2024
14 checks passed
@dbeatty10 dbeatty10 deleted the dbeatty/unknown-data-type-code-8912 branch April 12, 2024 18:16
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.

[Feature] Debug log when type_code fails to convert to a data_type
2 participants