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

Fix #9007: Make dbt-core compatible with Python 3.12 #9612

Merged
merged 8 commits into from
Feb 26, 2024
Merged

Fix #9007: Make dbt-core compatible with Python 3.12 #9612

merged 8 commits into from
Feb 26, 2024

Conversation

aranke
Copy link
Member

@aranke aranke commented Feb 21, 2024

part of fixing #9007

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/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 Feb 21, 2024
Copy link

codecov bot commented Feb 21, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 88.08%. Comparing base (2b23a03) to head (36c4671).
Report is 1 commits behind head on main.

Files Patch % Lines
core/dbt/utils.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9612      +/-   ##
==========================================
+ Coverage   88.01%   88.08%   +0.07%     
==========================================
  Files         177      177              
  Lines       22350    22356       +6     
==========================================
+ Hits        19671    19692      +21     
+ Misses       2679     2664      -15     
Flag Coverage Δ
integration 85.60% <75.00%> (+0.13%) ⬆️
unit 62.13% <25.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.

@aranke aranke force-pushed the fix_9007 branch 2 times, most recently from e9522d1 to 9673c4a Compare February 23, 2024 22:23
@aranke
Copy link
Member Author

aranke commented Feb 24, 2024

@MichelleArk Any idea why tests/unit/test_plugin_manager.py::TestPluginManager::test_get_nodes is failing across all Python versions here?

@aranke aranke marked this pull request as ready for review February 26, 2024 16:01
@aranke aranke requested a review from a team as a code owner February 26, 2024 16:01
@MichelleArk
Copy link
Contributor

@MichelleArk
Copy link
Contributor

Any idea why tests/unit/test_plugin_manager.py::TestPluginManager::test_get_nodes is failing across all Python versions here?

Discussed offline: It was surprising that the test passed in the first place with called_once_with, because there were always multiple calls to the tracking module, each with num_models as 1 (not 2, as the test was previous passing). Switching to assert_called_once_with on this branch actually brought this issue to light. We confirmed no actual change in behaviour across the branches and updated the test to be more precise / accurate using assert_has_calls

@aranke
Copy link
Member Author

aranke commented Feb 26, 2024

Do we also need to update main/core/setup.py#L88-L97?

Done, thanks!

@MichelleArk
Copy link
Contributor

I noticed that part of the acceptance criteria was to ensure that bundles can be created with Python 3.12. Should we confirm that before merging this?

@aranke
Copy link
Member Author

aranke commented Feb 26, 2024

I noticed that part of the acceptance criteria was to ensure that bundles can be created with Python 3.12. Should we confirm that before merging this?

How would you recommend I do this? I intended to merge this PR in, backport the change to 1.7, then test the created bundle for 1.7 with Python 3.12.

@MichelleArk
Copy link
Contributor

I intended to merge this PR in, backport the change to 1.7, then test the created bundle for 1.7 with Python 3.12.
Sounds great! 💪

@aranke aranke merged commit b337e0b into main Feb 26, 2024
63 checks passed
@aranke aranke deleted the fix_9007 branch February 26, 2024 20:27
Copy link
Contributor

The backport to 1.7.latest failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.7.latest 1.7.latest
# Navigate to the new working tree
cd .worktrees/backport-1.7.latest
# Create a new branch
git switch --create backport-9612-to-1.7.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b337e0b7263a01648028958dc3da3a145767b12b
# Push it to GitHub
git push --set-upstream origin backport-9612-to-1.7.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.7.latest

Then, create a pull request where the base branch is 1.7.latest and the compare/head branch is backport-9612-to-1.7.latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants