Skip to content

Fix crash on settable property alias #19615

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

Merged
merged 3 commits into from
Aug 8, 2025

Conversation

ilevkivskyi
Copy link
Member

Fixes #19572

Surprisingly, when working on this I found another inconsistency in how .definiton is set. So after all I decided to do some cleanup, now .definiton should always point do the Decortor if the definition is a decorated function (no matter whether it is a trivial decorator like @abstractmethod or @overload or a "real" one).

This comment has been minimized.

@sterliakov
Copy link
Collaborator

Primer output isn't obviously correct this time:

  • Could you check the last line of prefect diff? Looks like self binding is missed there for some reason.
  • Was the ibis note duplicated before? Or why is it gone?

Co-authored-by: Stanislav Terliakov <50529348+sterliakov@users.noreply.github.com>
@ilevkivskyi
Copy link
Member Author

@sterliakov the prefect change is correct. We normally prepend self in notes about incompatible override, it was omitted here because of a decorator with ParamSpec, but now it is consistent. The ibis change is a little bug in my PR, I am testing a fix locally now.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Aug 8, 2025

Diff from mypy_primer, showing the effect of this PR on open source code:

prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/blocks/core.py:1079: note: "load" of "Block" defined here
+ src/prefect/results.py:104: note: "get_default_result_storage" defined here
+ src/prefect/results.py:166: note: "resolve_result_storage" defined here
+ src/prefect/results.py:472: note: "_exists" of "ResultStore" defined here
+ src/prefect/results.py:551: note: "_read" of "ResultStore" defined here
+ src/prefect/results.py:745: note: "_persist_result_record" of "ResultStore" defined here
+ src/prefect/blocks/core.py:1177: note: "load_from_ref" of "Block" defined here
+ src/prefect/deployments/runner.py:992: note: "from_storage" of "RunnerDeployment" defined here
+ src/prefect/results.py:166: note: "resolve_result_storage" defined here
+ src/prefect/results.py:374: note: "update_for_flow" of "ResultStore" defined here
+ src/prefect/results.py:398: note: "update_for_task" of "ResultStore" defined here
+ src/prefect/artifacts.py:84: note: "create" of "Artifact" defined here
+ src/prefect/artifacts.py:151: note: "get" of "Artifact" defined here
+ src/prefect/artifacts.py:248: note: "format" of "Artifact" defined here
+ src/prefect/artifacts.py:334: note: "format" of "ProgressArtifact" defined here
- src/prefect/testing/fixtures.py:424: note:          def process_events(dequeue_events: bool = ..., min_events: int = ..., timeout: int = ...) -> Union[R?, Coroutine[Any, Any, R?]]
+ src/prefect/testing/fixtures.py:424: note:          def process_events(self, dequeue_events: bool = ..., min_events: int = ..., timeout: int = ...) -> Union[R?, Coroutine[Any, Any, R?]]

Copy link
Collaborator

@sterliakov sterliakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now, thanks!

@ilevkivskyi ilevkivskyi merged commit 04f38f5 into python:master Aug 8, 2025
20 checks passed
@ilevkivskyi ilevkivskyi deleted the fix-property-alias branch August 8, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mypy crash on master with property alias with setters
2 participants