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 Typing to the dbt.task Module #10622

Merged
merged 3 commits into from
Aug 28, 2024
Merged

Add More Typing to the dbt.task Module #10622

merged 3 commits into from
Aug 28, 2024

Conversation

peterallenwebb
Copy link
Contributor

Add type annotations, with only a few minor code changes.

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 or 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.

@peterallenwebb peterallenwebb requested a review from a team as a code owner August 27, 2024 21:46
@cla-bot cla-bot bot added the cla:yes label Aug 27, 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 Aug 27, 2024

Codecov Report

Attention: Patch coverage is 92.07921% with 8 lines in your changes missing coverage. Please review.

Project coverage is 88.92%. Comparing base (f25a474) to head (08dcf4e).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10622   +/-   ##
=======================================
  Coverage   88.91%   88.92%           
=======================================
  Files         180      180           
  Lines       22760    22776   +16     
=======================================
+ Hits        20237    20253   +16     
  Misses       2523     2523           
Flag Coverage Δ
integration 86.23% <92.07%> (+<0.01%) ⬆️
unit 62.34% <87.12%> (+0.01%) ⬆️

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

Components Coverage Δ
Unit Tests 62.34% <87.12%> (+0.01%) ⬆️
Integration Tests 86.23% <92.07%> (+<0.01%) ⬆️

@peterallenwebb peterallenwebb added the Skip Changelog Skips GHA to check for changelog file label Aug 27, 2024
@@ -547,6 +547,8 @@ def compile_node(
the node's raw_code into compiled_code, and then calls the
recursive method to "prepend" the ctes.
"""
# REVIEW: UnitTestDefinition shouldn't be possible here because of the
# type of node, and it is likewise an invalid return type.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't actually remember why this is here. We went around a couple of times on different ways of handling unit tests, so my guess is that this might have come from an earlier iteration, before we switched to making a separate unit test manifest. My recommendation is to remove it and see if any tests fail.

@@ -28,18 +29,19 @@ def handle_exception(self, e, ctx):
exc=str(e), exc_info=traceback.format_exc(), node_info=self.node.node_info
)
)
# REVIEW: This code is invalid and will always throw.
Copy link
Contributor

Choose a reason for hiding this comment

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

My guess here is that sometimes we were getting DbtRuntimeErrors without a node, and some of the message creation wouldn't work, but that subsequent refactoring has made it non-functional? It seems like a pretty bad thing if it always throws. Does anything break if it's removed?

@peterallenwebb peterallenwebb merged commit f7d21e0 into main Aug 28, 2024
66 checks passed
@peterallenwebb peterallenwebb deleted the paw/typing-day branch August 28, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants