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

Support for redshift 821 #10448

Merged
merged 15 commits into from
Jul 22, 2024
Merged

Support for redshift 821 #10448

merged 15 commits into from
Jul 22, 2024

Conversation

VersusFacit
Copy link
Contributor

take 2 on #10366

Problem

Merge of the original code with an exception for a case the team thought to be unlikely to exist, did in fact exist in one of our downstream analytics projects.

I conferred with the team and we have landed on instead logging a warning and letting the code move ahead after making an effort to float non-None value columns to the first row inserted from an excepted fixture.

Solution

Borrowing the existing dbt_common event to avoid adding yet another message type for a one-off error. Also, we will propose floating this logic to dbt adapters at some point, so we don't want to bake in too much logic right now.

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, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

@VersusFacit VersusFacit self-assigned this Jul 16, 2024
@VersusFacit VersusFacit requested a review from a team as a code owner July 16, 2024 12:12
@cla-bot cla-bot bot added the cla:yes label Jul 16, 2024
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.85%. Comparing base (4c7d922) to head (1939ae1).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10448      +/-   ##
==========================================
+ Coverage   88.76%   88.85%   +0.09%     
==========================================
  Files         180      180              
  Lines       22564    22573       +9     
==========================================
+ Hits        20029    20058      +29     
+ Misses       2535     2515      -20     
Flag Coverage Δ
integration 86.15% <92.30%> (+0.11%) ⬆️
unit 62.22% <100.00%> (+0.12%) ⬆️

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

Components Coverage Δ
Unit Tests 62.22% <100.00%> (+0.12%) ⬆️
Integration Tests 86.15% <92.30%> (+0.11%) ⬆️

if non_none_row_index is None:
fire_event(
SystemStdErr(
bmsg="Unit Test fixtures benefit from having at least one row free of Null values to ensure consistent column types. Failure to meet this recommendation can result in type mismatch errors between unit test source models and `expected` fixtures."
Copy link
Contributor

@MichelleArk MichelleArk Jul 17, 2024

Choose a reason for hiding this comment

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

this is very clear from my perspective reading this diff but I'm worried it's somewhat verbose for an end-user reading this. What about something more straightforward like:

"Unit test fixutre <fixture-name> in <unit-test-name> does not have any row free of null values, which may cause type mismatch errors during unit test execution."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll take this suggestion for the user facing exception to be raised in redshift

@VersusFacit VersusFacit requested a review from MichelleArk July 22, 2024 18:20
@VersusFacit VersusFacit merged commit 79ad0a3 into main Jul 22, 2024
66 checks passed
@VersusFacit VersusFacit deleted the support_for_redshift_821 branch July 22, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants