Skip to content
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

[1.7.13] type checker thinks RunRequest(...) returns None #23214

Closed
alangenfeld opened this issue Jul 24, 2024 · 0 comments · Fixed by #23213
Closed

[1.7.13] type checker thinks RunRequest(...) returns None #23214

alangenfeld opened this issue Jul 24, 2024 · 0 comments · Fixed by #23213

Comments

@alangenfeld
Copy link
Member

alangenfeld commented Jul 24, 2024

examples of how this can manifest:

  Type "() -> Generator[None, Any, None]" is incompatible with type "RawSensorEvaluationFunction"
    Function return type "Generator[None, Any, None]" is incompatible with type "RawSensorEvaluationFunctionReturn"
      Type "Generator[None, Any, None]" is incompatible with type "RawSensorEvaluationFunctionReturn"
        "Generator[None, Any, None]" is incompatible with "Iterator[SkipReason | RunRequest | DagsterRunReaction | SensorResult]"
          Type parameter "_T_co@Iterator" is covariant, but "None" is not a subtype of "SkipReason | RunRequest | DagsterRunReaction | SensorResult"
        "Generator[None, Any, None]" is incompatible with "Sequence[RunRequest]"
        "Generator[None, Any, None]" is incompatible with "SkipReason"
        "Generator[None, Any, None]" is incompatible with "RunRequest"Pylance[reportArgumentType](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportArgumentType)
        Return type of generator function must be compatible with "Generator[None, Any, Any]"
  "None" is incompatible with "RunRequest"Pylance[reportReturnType](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportReturnType)
smackesey pushed a commit that referenced this issue Jul 25, 2024
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 #23214

## How I Tested These Changes

manually made the change in `site-packages` of installed copy of
`1.7.13`
hellendag pushed a commit that referenced this issue Jul 25, 2024
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 #23214

## How I Tested These Changes

manually made the change in `site-packages` of installed copy of
`1.7.13`
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 a pull request may close this issue.

1 participant