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 #8957

Closed
wants to merge 9 commits into from

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Oct 31, 2023

resolves dbt-labs/dbt-postgres#38

Problem

If someone is using the Column.data_type from a get_column_schema_from_query call (like described in #8877), it might not be obvious when a translation from type_code wasn't available.

Solution

When a translation isn't possible, fire a debug-level logging event that is specific to this situation. Namely, a logging event like this:

[0m15:55:59.634717 [debug] [Thread-1  ]: The `type_code` 790 was not recognized, which may affect error messages for enforced contracts that fail as well as `Column.data_type` values returned by `get_column_schema_from_query`

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 some feedback from Product or DX, but still needs final approval
  • This PR includes type annotations for new and modified functions

@cla-bot cla-bot bot added the cla:yes label Oct 31, 2023
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.44%. Comparing base (7317de2) to head (485395c).
Report is 164 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    dbt-labs/dbt-core#8957      +/-   ##
==========================================
- Coverage   86.49%   86.44%   -0.06%     
==========================================
  Files         177      177              
  Lines       26405    26416      +11     
==========================================
- Hits        22840    22834       -6     
- Misses       3565     3582      +17     
Flag Coverage Δ
integration 83.22% <100.00%> (-0.13%) ⬇️
unit 64.80% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbeatty10 dbeatty10 marked this pull request as ready for review October 31, 2023 23:52
@dbeatty10 dbeatty10 requested review from a team as code owners October 31, 2023 23:52
@dbeatty10 dbeatty10 added Team:Adapters Issues designated for the adapter area of the code dbt-adapters Needs migration to the dbt-adapters repo labels Mar 23, 2024
@dbeatty10 dbeatty10 closed this Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes dbt-adapters Needs migration to the dbt-adapters repo Team:Adapters Issues designated for the adapter area of the code
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
1 participant