Repository navigation
Rebase attributes facets when base type is replaced - #5112
Open
tonyyuyiding wants to merge 1 commit into
Open
tonyyuyiding wants to merge 1 commit into
tonyyuyiding wants to merge 1 commit into
Conversation
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D123601975. (Because this pull request was imported automatically, there will not be any future comments.) |
|
Diff from mypy_primer, showing the effect of this PR on open source code: ============================================================
SUMMARY
============================================================
Total: +6 new errors, -9 fixed errors
By preset: +0/-2 (default), +0/-2 (strict)
Projects with changes (4):
mitmproxy: +1 -5
jax: +5 -0
pandas: +0 -3
werkzeug: +0 -1
============================================================
FULL DIFF DETAILS
------------------------------------------------------------
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- ERROR mitmproxy/addons/export.py:22:15-31: The type of `request` is unknown; it is inferred as an implicit `Any` [unknown-variable-type]
- ERROR mitmproxy/addons/export.py:24:12-19: Returning implicit Any from function declared to return "Request" [no-any-return-implicit]
- ERROR mitmproxy/addons/export.py:43:12-20: Returning implicit Any from function declared to return "Response" [no-any-return-implicit]
+ ERROR mitmproxy/flowfilter.py:523:21-40: Implicit conversion of `list[Question]` to `bool` is not allowed [implicit-bool]
- ERROR mitmproxy/flowfilter.py:521:40-60: The type of this argument is unknown [unknown-argument-type]
- ERROR mitmproxy/flowfilter.py:523:60-87: The type of this argument is unknown [unknown-argument-type]
jax (https://github.com/google/jax)
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:392:46-56: The type of this argument is unknown [unknown-argument-type]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:400:63-73: The type of this argument is unknown [unknown-argument-type]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:405:64-74: The type of this argument is unknown [unknown-argument-type]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:3681:56-72: The type of this argument is unknown [unknown-argument-type]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:3689:56-72: The type of this argument is unknown [unknown-argument-type]
pandas (https://github.com/pandas-dev/pandas)
- ERROR pandas/core/reshape/merge.py:2682:21-43: The type of this argument is unknown [unknown-argument-type]
- ERROR pandas/core/reshape/merge.py:2691:32-63: Object of type `ExtensionDtype | dtype | Unknown` has no attribute `pyarrow_dtype` [missing-attribute]
- ERROR pandas/tests/indexes/test_old_base.py:602:63-74: The type of this argument is unknown [unknown-argument-type]
werkzeug (https://github.com/pallets/werkzeug)
- ERROR tests/test_local.py:208:12-41: `in` is not supported between `Literal['int(']` and `None` [not-iterable] |
This branch has not been deployed
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
Fixes #5016
This PR fixes the core problem in the original issue. I left a comment under the issue for two follow-ups that this PR does not cover. Please check #5016 (comment)
The script below shows the core problem. The
if o.x: passwrites an attribute facet forx(int | None).isinstancethen replaces the base typeAwithB, but the facet is left unchanged. Therefore, when the attribute is read from facets, we get the outdated record.In the PR, I added a rebase step after type change, which updates the records in
facetsaccording to the newtyby intersecting with the attributes defined in the class.Test Plan
A test has been added in
attribute_narrow.rs