[pyrefly] Preserve literal keys in dict unions - #4388
Open
lyydsheep wants to merge 1 commit into
Open
Conversation
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D114457106. (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: rotki (https://github.com/rotki/rotki)
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `and_op` with type `bool` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `limit` with type `int | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `offset` with type `int | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `from_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `to_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `assets` with type `tuple[Asset, ...] | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `location` with type `Location | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `entry_types` with type `IncludeExcludeFilterData | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `exclude_ignored_assets` with type `bool` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `notes_substring` with type `str | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `min_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:802:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `max_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.EvmEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `and_op` with type `bool` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `limit` with type `int | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `offset` with type `int | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `from_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `to_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `assets` with type `tuple[Asset, ...] | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `location` with type `Location | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `entry_types` with type `IncludeExcludeFilterData | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `exclude_ignored_assets` with type `bool` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `notes_substring` with type `str | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `min_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:813:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `max_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.SolanaEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `and_op` with type `bool` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `limit` with type `int | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `offset` with type `int | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `from_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `to_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `assets` with type `tuple[Asset, ...] | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `location` with type `Location | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `entry_types` with type `IncludeExcludeFilterData | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `exclude_ignored_assets` with type `bool` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `notes_substring` with type `str | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `min_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:826:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `max_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.HistoryEventWithCounterpartyFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `and_op` with type `bool` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `limit` with type `int | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `offset` with type `int | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `from_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `to_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `assets` with type `tuple[Asset, ...] | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `location` with type `Location | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `entry_types` with type `IncludeExcludeFilterData | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `exclude_ignored_assets` with type `bool` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `notes_substring` with type `str | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `min_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:831:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `max_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.HistoryEventWithTxRefFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `and_op` with type `bool` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `limit` with type `int | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `offset` with type `int | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `from_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `to_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `assets` with type `tuple[Asset, ...] | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `location` with type `Location | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `entry_types` with type `IncludeExcludeFilterData | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `exclude_ignored_assets` with type `bool` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `notes_substring` with type `str | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `min_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:835:17-35: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `max_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.EthStakingEventFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `and_op` with type `bool` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `limit` with type `int | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `offset` with type `int | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `from_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `to_ts` with type `Timestamp | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `assets` with type `tuple[Asset, ...] | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `location` with type `Location | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `entry_types` with type `IncludeExcludeFilterData | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `exclude_ignored_assets` with type `bool` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `notes_substring` with type `str | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `min_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/api/v1/schemas.py:839:57-75: Unpacked keyword argument `list[Any] | Any | None` is not assignable to parameter `max_amount` with type `FVal | None` in function `rotkehlchen.db.filtering.HistoryBaseEntryFilterQuery.make` [bad-argument-type]
- ERROR rotkehlchen/assets/asset.py:518:13-37: Result of call expression is of type `str | Any | None` and is not used; assign to `_` if this is intentional [unused-call-result]
pytest (https://github.com/pytest-dev/pytest)
- ERROR src/_pytest/config/argparsing.py:61:41-66:2: `dict[type[bool] | type[float] | type[int] | type[str] | Any, str | Any]` is not assignable to `dict[object, _IniTypeTag]` [bad-assignment]
|
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.
Fixes #4380
When a built-in dict is merged with a dict-literal RHS using
|or|=, Pyrefly now applies a soft contextual hint from the lhs while inferring the literal. CompatibleLiteralkeys remain precise without changing ordinary dict inference or other operators; incompatible keys and values still report assignment errors.Validation:
cargo test -p pyrefly test::operatorspython3 test.py --no-test --no-tensor-shapes --no-conformance --no-jsonschemaThe local
.scratchplanning files are intentionally not part of this PR.