You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fix] Use correct optional typing in WorkspaceClient for mypy (#760)
Without this change, the SDK is not very `mypy`-compatible. This PR
fixes `arg-type` check:
```
cmd [3] | mypy --disable-error-code 'annotation-unchecked' --exclude 'tests/resources/*' --exclude dist .
error: Argument "auth_type" to "WorkspaceClient" has incompatible type "str | None"; expected "str" [arg-type]
error: Argument "token" to "WorkspaceClient" has incompatible type "str | None"; expected "str" [arg-type]
```
`Optional[X]` is py3.8 and py3.9 way of expressing optional types, but
in py3.10+ it gets transformed into a union type of `X | None`, which is
not supported by py3.9. py3.9 EOL is 31 Oct 2025, so we have to deal
with it somehow until then.
0 commit comments