Miksus / rocketry

Modern scheduling library for Python
https://rocketry.readthedocs.io
MIT License
3.23k stars 105 forks source link

BUG Literal is incompatible with "NotSet" #173

Closed tekumara closed 1 year ago

tekumara commented 1 year ago

Describe the bug

With Vscode's Pylance:

Argument of type "Literal['#test-me']" cannot be assigned to parameter "default" of type "NotSet" in function "__init__"
  "Literal['#test-me']" is incompatible with "NotSet" Pylance[reportGeneralTypeIssues](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportGeneralTypeIssues)
CleanShot 2022-12-12 at 21 16 53@2x

To Reproduce

@app.task(daily.at("8am"))
async def daily_notification(channel=EnvArg("CHANNEL", default="#test-me")) -> None:

Expected behavior

No type error, ie: the default field can take NotSet | str.

rocketry 2.5.1