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

[CT-3267] [Feature] Debug log when type_code fails to convert to a data_type #39

Merged
merged 15 commits into from
Apr 19, 2024

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Mar 24, 2024

resolves #38

Problem

Postgres allows user defined data types. It also has some non-standard data types like money, uuid, etc. If dbt doesn't recognize the data type, dbt doesn't completely fail, but it also doesn't explain what's going on.

Solution

Uses dbt-labs/dbt-adapters#135 to 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

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

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.

Looks good, just remember to revert the dependencies to point to main.

pyproject.toml Outdated Show resolved Hide resolved
hatch_build.py Outdated Show resolved Hide resolved
dbt/adapters/postgres/connections.py Outdated Show resolved Hide resolved
@mikealfare mikealfare self-assigned this Apr 19, 2024
@mikealfare
Copy link
Contributor

I think this is going to be easier to merge post the pre-commit merge, so I'd like to get that in first and then rebase this PR. I added it to my sprint backlog for this sprint so I don't lose track of it.

# Conflicts:
#	hatch_build.py
#	pyproject.toml
@mikealfare mikealfare enabled auto-merge (squash) April 19, 2024 17:24
@mikealfare mikealfare merged commit 118fbbd into main Apr 19, 2024
17 checks passed
@mikealfare mikealfare deleted the dbeatty/unknown-data-type-code-8912 branch April 19, 2024 17: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.

[CT-3267] [Feature] Debug log when type_code fails to convert to a data_type
3 participants