ref(utils): Explicitly use None default when checking metadata#4039
ref(utils): Explicitly use None default when checking metadata#4039sentrivana merged 2 commits intogetsentry:masterfrom
Conversation
|
@sentrivana I updated with master (I think I was missing some recent test fixes), can you re-add the tests trigger |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #4039 +/- ##
==========================================
- Coverage 80.25% 80.24% -0.01%
==========================================
Files 139 139
Lines 15403 15403
Branches 2605 2605
==========================================
- Hits 12361 12360 -1
Misses 2202 2202
- Partials 840 841 +1
|
|
@mpurnell1 Thanks for updating, that should pull in fixes for the GraphQL test suites from master. You can ignore the AWS Lambda test failures on this PR, as long as the Common tests are passing and CI / Lint Sources is green, we're good to go. That being said, the latter is failing because mypy is complaining about |
|
Thank you! |
Fixes #4035
As described in the above issue, starting in Python 3.14 importlib_metadata 8 provides the desired behavior, raising KeyError on a missing key. In preparation for this change, and to remove a DeprecationWarning, we should explicitly default to None when getting metadata.
I encountered an issue while linting, inside importlib.metadata. It appears the type hint for Distribution.metadata shows it returning _meta.PackageMetadata, even though it actually returns _adapter.Message. I don't think that is within the scope of this PR, but I may bring it to their attention.Invalid linting error ignored with comment.