perf: replace 'in dict.keys()' with 'in dict' for better performance
Remove unnecessary .keys() calls in dictionary membership checks. This avoids creating view objects and improves readability.
- core/dbt/context/base.py: diff_of_two_dicts()
- core/dbt/contracts/graph/manifest.py: build_node_edges(), build_macro_edges()
- core/dbt/task/init.py: profile check
Resolves #
Problem
Solution
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.
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.
In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.
CLA has not been signed by users: @christopherrya
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.
Codecov Report
:x: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 91.93%. Comparing base (48218be) to head (84585cb).
:warning: Report is 35 commits behind head on main.
:x: Your patch check has failed because the patch coverage (75.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files
@@ Coverage Diff @@
## main #12191 +/- ##
==========================================
- Coverage 91.99% 91.93% -0.06%
==========================================
Files 203 203
Lines 24863 24863
==========================================
- Hits 22872 22859 -13
- Misses 1991 2004 +13
| Flag | Coverage Δ | |
|---|---|---|
| integration | 88.82% <75.00%> (-0.12%) |
:arrow_down: |
| unit | 65.17% <25.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Δ | |
|---|---|---|
| Unit Tests | 65.17% <25.00%> (ø) |
|
| Integration Tests | 88.82% <75.00%> (-0.12%) |
:arrow_down: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@christopherrya we started requiring commits with verified signatures a few months ago. Unfortunately, we need to get the commits of this PR signed before we can proceed 😞
If you don't have a GPG key already github has guides
Generating a new GPG key Adding a GPG key to your GitHub account Tell the git CLI about your GPG key And then here is a stackoverflow about how to sign all commits on a branch: https://stackoverflow.com/a/41883164