-
Notifications
You must be signed in to change notification settings - Fork 243
fix: Missing property becomes object #1945
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
base: main
Are you sure you want to change the base?
Conversation
|
@yangdanny97 has imported this pull request. If you are a Meta employee, you can view this in D89890425. |
This comment has been minimized.
This comment has been minimized.
|
@yangdanny97 Can you review this PR? Thank you |
|
Yep, I'll try to get to this tomorrow (or early next week) |
This comment has been minimized.
This comment has been minimized.
|
Diff from mypy_primer, showing the effect of this PR on open source code: hydpy (https://github.com/hydpy-dev/hydpy)
- ERROR hydpy/models/wq/wq_model.py:1027:28-38: `object` is not assignable to `float` [bad-assignment]
+ ERROR hydpy/models/wq/wq_model.py:1027:28-38: Object of class `TypeVar` has no attribute `weight` [missing-attribute]
- ERROR hydpy/models/wq/wq_model.py:1482:38-54: `-` is not supported between `float` and `object` [unsupported-operation]
+ ERROR hydpy/models/wq/wq_model.py:1482:44-54: Object of class `TypeVar` has no attribute `weight` [missing-attribute]
+ ERROR hydpy/models/wq/wq_model.py:1484:21-31: Object of class `TypeVar` has no attribute `weight` [missing-attribute]
- ERROR hydpy/models/wq/wq_model.py:1549:39-55: `-` is not supported between `float` and `object` [unsupported-operation]
+ ERROR hydpy/models/wq/wq_model.py:1549:45-55: Object of class `TypeVar` has no attribute `weight` [missing-attribute]
+ ERROR hydpy/models/wq/wq_model.py:1551:21-31: Object of class `TypeVar` has no attribute `weight` [missing-attribute]
schemathesis (https://github.com/schemathesis/schemathesis)
- ERROR src/schemathesis/specs/openapi/analysis.py:123:35-50: Argument `object` is not assignable to parameter `operation` with type `str` in function `schemathesis.resources.repository.ResourceRepository.record_response` [bad-argument-type]
+ ERROR src/schemathesis/specs/openapi/analysis.py:123:35-50: Object of class `InvalidSchema` has no attribute `label` [missing-attribute]
stone (https://github.com/dropbox/stone)
- ERROR test/test_backend.py:380:17-43: Cannot index into `object` [bad-index]
+ ERROR test/test_backend.py:380:17-40: Object of class `NoneType` has no attribute `fields` [missing-attribute]
apprise (https://github.com/caronc/apprise)
+ ERROR apprise/logger.py:53:19-32: No attribute `TRACE` in module `logging` [missing-attribute]
+ ERROR apprise/logger.py:59:19-36: No attribute `DEPRECATE` in module `logging` [missing-attribute]
pandas (https://github.com/pandas-dev/pandas)
+ ERROR pandas/core/algorithms.py:554:21-33: Object of class `SequenceNotStr` has no attribute `dtype`
+ Object of class `range` has no attribute `dtype` [missing-attribute]
- ERROR pandas/core/reshape/merge.py:2438:41-54: Argument `list[Unknown | None] | Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR pandas/core/reshape/merge.py:2438:41-54: Argument `Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR pandas/core/reshape/merge.py:2442:24-54: `+` is not supported between `None` and `list[Unknown | None]` [unsupported-operation]
+ ERROR pandas/core/reshape/merge.py:2442:24-54: `+` is not supported between `None` and `list[@_]` [unsupported-operation]
+ ERROR pandas/tests/copy_view/test_methods.py:1088:33-46: Object of class `Interval` has no attribute `values`
+ Object of class `Timedelta` has no attribute `values`
+ Object of class `Timestamp` has no attribute `values`
+ Object of class `bool` has no attribute `values`
+ Object of class `bytes` has no attribute `values`
+ Object of class `complex` has no attribute `values`
+ Object of class `complexfloating` has no attribute `values`
+ Object of class `date` has no attribute `values`
+ Object of class `datetime64` has no attribute `values`
+ Object of class `datetime` has no attribute `values`
+ Object of class `float` has no attribute `values`
+ Object of class `floating` has no attribute `values`
+ Object of class `int` has no attribute `values`
+ Object of class `integer` has no attribute `values`
+ Object of class `str` has no attribute `values`
+ Object of class `timedelta64` has no attribute `values`
+ Object of class `timedelta` has no attribute `values` [missing-attribute]
+ Object of class `ndarray` has no attribute `codes` [missing-attribute]
+ ERROR pandas/tests/copy_view/test_replace.py:140:33-42: Object of class `ExtensionArray` has no attribute `codes`
+ Object of class `ndarray` has no attribute `_ndarray` [missing-attribute]
+ ERROR pandas/tests/indexes/test_old_base.py:297:21-43: Object of class `ExtensionArray` has no attribute `_ndarray`
freqtrade (https://github.com/freqtrade/freqtrade)
- ERROR freqtrade/rpc/discord.py:57:21-47: Object of class `int` has no attribute `append` [missing-attribute]
+ ERROR freqtrade/rpc/discord.py:57:21-47: Object of class `int` has no attribute `append`
+ Object of class `str` has no attribute `append` [missing-attribute]
pwndbg (https://github.com/pwndbg/pwndbg)
- ERROR pwndbg/dbg_mod/lldb/repl/fuzzy.py:251:22-37: No matching overload found for function `open` called with arguments: (object) [no-matching-overload]
+ ERROR pwndbg/dbg_mod/lldb/repl/fuzzy.py:251:23-36: Object of class `LLDBHistory` has no attribute `filename` [missing-attribute]
scrapy (https://github.com/scrapy/scrapy)
+ ERROR tests/test_downloadermiddleware_httpcache.py:161:21-34: Object of class `PolicyTestMixin` has no attribute `response` [missing-attribute]
- ERROR tests/test_request_cb_kwargs.py:167:20-41: Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR tests/test_request_cb_kwargs.py:167:20-41: Object of class `NoneType` has no attribute `checks`
+ Object of class `Spider` has no attribute `checks` [missing-attribute]
|
|
Sorry, I got caught up in some urgent work and didn't get to it this week. This is the first PR I will review when I have time |
|
Okay |
Summary
In
AnswersSolver::narrow, short-circuitAtomicNarrowOp::CallandAtomicNarrowOp::NotCallwhenresolve_narrowing_callreturnsNone. This prevents evaluating the facet chain type for non-narrowing calls, so missing attributes do not get refined toobject.Fixes #930
Test Plan
cargo test pyrefly:pyrefly_library -- test_missing_attribute_call_does_not_narrow