Skip to content

Commit 3567d1f

Browse files
authored
Fix mypy failure on CI (#7198)
1 parent c349f4f commit 3567d1f

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

distributed/shuffle/shuffle.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING
3+
from typing import TYPE_CHECKING, Any
44

55
from dask.base import tokenize
66
from dask.highlevelgraph import HighLevelGraph
@@ -91,15 +91,15 @@ def rearrange_by_column_p2p(
9191
class P2PShuffleLayer(SimpleShuffleLayer):
9292
def __init__(
9393
self,
94-
name,
95-
column,
96-
npartitions,
97-
npartitions_input,
98-
ignore_index,
99-
name_input,
100-
meta_input,
101-
parts_out=None,
102-
annotations=None,
94+
name: str,
95+
column: str,
96+
npartitions: int,
97+
npartitions_input: int,
98+
ignore_index: bool,
99+
name_input: str,
100+
meta_input: pd.DataFrame,
101+
parts_out: list | None = None,
102+
annotations: dict | None = None,
103103
):
104104
annotations = annotations or {}
105105
annotations.update({"shuffle": lambda key: key[1]})
@@ -115,16 +115,16 @@ def __init__(
115115
annotations=annotations,
116116
)
117117

118-
def get_split_keys(self):
118+
def get_split_keys(self) -> list:
119119
# TODO: This is doing some funky stuff to set priorities but we don't need this
120120
return []
121121

122-
def __repr__(self):
122+
def __repr__(self) -> str:
123123
return (
124124
f"{type(self).__name__}<name='{self.name}', npartitions={self.npartitions}>"
125125
)
126126

127-
def _cull(self, parts_out):
127+
def _cull(self, parts_out: list) -> P2PShuffleLayer:
128128
return P2PShuffleLayer(
129129
self.name,
130130
self.column,
@@ -136,9 +136,9 @@ def _cull(self, parts_out):
136136
parts_out=parts_out,
137137
)
138138

139-
def _construct_graph(self, deserializing=None):
139+
def _construct_graph(self, deserializing: Any = None) -> dict[tuple | str, tuple]:
140140
token = tokenize(self.name_input, self.column, self.npartitions, self.parts_out)
141-
dsk = {}
141+
dsk: dict[tuple | str, tuple] = {}
142142
barrier_key = "shuffle-barrier-" + token
143143
name = "shuffle-transfer-" + token
144144
tranfer_keys = list()

0 commit comments

Comments
 (0)