[ty] Report deprecated unary operations - #27584
Open
Andrej730 wants to merge 3 commits into
Open
Conversation
ty] Report deprecated unary operationsty] Report deprecated unary operations
ty] Report deprecated unary operations
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 96.96%. The percentage of expected errors that received a diagnostic held steady at 92.96%. The number of fully passing files held steady at 106/133. |
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
deprecated |
16 | 0 | 0 |
| Total | 16 | 0 | 0 |
Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.
Raw diff (16 changes)
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/categorical.py:3127:29 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ pandas/core/indexes/base.py:3901:32 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ pandas/tests/computation/test_eval.py:589:70 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ pandas/tests/computation/test_eval.py:593:71 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ pandas/tests/frame/test_reductions.py:2109:26 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ pandas/tests/frame/test_reductions.py:2109:39 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
pandera (https://github.com/pandera-dev/pandera)
+ pandera/backends/pyspark/builtin_checks.py:133:34 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ pandera/backends/pyspark/builtin_checks.py:157:34 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
scipy (https://github.com/scipy/scipy)
+ scipy/linalg/_decomp.py:45:28 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ scipy/ndimage/_measurements.py:689:12 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ scipy/ndimage/_measurements.py:691:10 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ scipy/ndimage/_measurements.py:697:16 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ scipy/stats/_stats_py.py:9240:45 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
+ scipy/stats/_stats_py.py:9260:45 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
spark (https://github.com/apache/spark)
+ python/pyspark/ml/tests/test_feature.py:939:30 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
xarray (https://github.com/pydata/xarray)
+ xarray/tests/test_variable.py:458:22 warning[deprecated] The function `__invert__` is deprecated: Will throw an error in Python 3.16. Use `not` for logical negation of bools instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hi! Stumbled upon
~Truenot being reported as deprecated, went investigating and turned out there were two cases:__invert__and bool literals - now it tries to find__invert__on bool and reports it as deprecated, otherwise it's using fallback which is covering the future, whenbool.__invert__will be completely removedExamples:
Example diagnostics
Test Plan
Added mdtest to
deprecated.md, updatedintegers.mdtest to consider deprecation diagnostic. All previous tests also pass.