Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
[record] IHaveNew.__new__ Self return typehint (dagster-io#23213)
Browse files Browse the repository at this point in the history
it appears that when installed, `@record_custom` + `IHaveNew` is
assuming `__new__` returns `None` instead of `Unknown` causing it to
believe `x` is `None` for `x = RunRecord()`

explicitly tag `__new__`'s return to `Self` to resolve

resolves dagster-io#23214

## How I Tested These Changes

manually made the change in `site-packages` of installed copy of
`1.7.13`
  • Loading branch information
alangenfeld authored Jul 25, 2024
1 parent dbeb68c commit 7a71aa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python_modules/dagster/dagster/_record/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
overload,
)

from typing_extensions import dataclass_transform
from typing_extensions import Self, dataclass_transform

import dagster._check as check
from dagster._check import EvalContext, build_check_call_str
Expand Down Expand Up @@ -245,7 +245,7 @@ class IHaveNew:

if TYPE_CHECKING:

def __new__(cls, **kwargs): ...
def __new__(cls, **kwargs) -> Self: ...


def is_record(obj) -> bool:
Expand Down

0 comments on commit 7a71aa8

Please sign in to comment.