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

Add more package validation #9986

Merged
merged 6 commits into from
Apr 24, 2024
Merged

Add more package validation #9986

merged 6 commits into from
Apr 24, 2024

Conversation

emmyoop
Copy link
Member

@emmyoop emmyoop commented Apr 19, 2024

resolves #9985

Problem

dbt hangs when packages have empty values. This is generally not intentional but the result of empty env-vars.

Solution

Add validation

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

@cla-bot cla-bot bot added the cla:yes label Apr 19, 2024
@emmyoop emmyoop changed the title Er/packages validation Add more package validation Apr 19, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link

codecov bot commented Apr 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.19%. Comparing base (27943a5) to head (3cf437e).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9986      +/-   ##
==========================================
+ Coverage   88.17%   88.19%   +0.02%     
==========================================
  Files         181      181              
  Lines       22614    22632      +18     
==========================================
+ Hits        19939    19961      +22     
+ Misses       2675     2671       -4     
Flag Coverage Δ
integration 85.57% <100.00%> (+<0.01%) ⬆️
unit 62.26% <57.14%> (+0.05%) ⬆️

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.

@emmyoop emmyoop marked this pull request as ready for review April 22, 2024 20:48
@emmyoop emmyoop requested a review from a team as a code owner April 22, 2024 20:48
if isinstance(package, dict):
if package.get("package") == "":
raise ValidationError(
"A package is missing the value. It is a required property."
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add some more detailed message here to help folks narrow down the problem since we already know what type is missing value here?

Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

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

Other than the one comment things look good to me ! feel free to merge after taking a look at that comment.

@emmyoop emmyoop merged commit 0dc2a2f into main Apr 24, 2024
62 checks passed
@emmyoop emmyoop deleted the er/packages-validation branch April 24, 2024 01:17
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.

[Bug] dbt hangs when packages have empty values
2 participants