Skip to content

Commit

Permalink
mypy --no-implicit-optional (#6606)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky authored Jun 23, 2022
1 parent f0680c9 commit dc019ed
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion distributed/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4057,7 +4057,7 @@ def log_event(self, topic: str | Collection[str], msg: Any):
"""
return self.sync(self.scheduler.log_event, topic=topic, msg=msg)

def get_events(self, topic: str = None):
def get_events(self, topic: str | None = None):
"""Retrieve structured topic logs
Parameters
Expand Down
2 changes: 1 addition & 1 deletion distributed/shuffle/shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_ext() -> ShuffleWorkerExtension:
def shuffle_transfer(
input: pd.DataFrame,
id: ShuffleId,
npartitions: int = None,
npartitions: int | None = None,
column: str | None = None,
) -> None:
get_ext().add_partition(input, id, npartitions=npartitions, column=column)
Expand Down
2 changes: 1 addition & 1 deletion distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ def update_data(
self,
data: dict[str, object],
report: bool = True,
stimulus_id: str = None,
stimulus_id: str | None = None,
) -> dict[str, Any]:
self.handle_stimulus(
UpdateDataEvent(
Expand Down
2 changes: 1 addition & 1 deletion distributed/worker_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ def __init__(
*,
nthreads: int = 1,
address: str | None = None,
data: MutableMapping[str, object] = None,
data: MutableMapping[str, object] | None = None,
threads: dict[str, int] | None = None,
plugins: dict[str, WorkerPlugin] | None = None,
resources: Mapping[str, float] | None = None,
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ platform = linux
allow_incomplete_defs = false
allow_untyped_decorators = false
ignore_missing_imports = true
no_implicit_optional = true
show_error_codes = true
warn_redundant_casts = true
warn_unused_ignores = true
Expand All @@ -123,6 +124,7 @@ warn_unreachable = true
allow_incomplete_defs = true
[mypy-distributed.scheduler]
allow_incomplete_defs = true
no_implicit_optional = false
[mypy-distributed.worker]
allow_incomplete_defs = true

Expand Down

0 comments on commit dc019ed

Please sign in to comment.