Skip to content

Commit 9d07d86

Browse files
committed
Fixed uncovered issue with nx.draw_networkx and node colors
1 parent c66a4c5 commit 9d07d86

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

execution_process_metrics_collector/aggregator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
MutableSequence,
3535
Optional,
3636
Sequence,
37+
Union,
3738
)
3839

3940
import pandas as pd
@@ -128,6 +129,7 @@ def draw_tree(
128129
ax.margins(0)
129130
plt.axis("off")
130131

132+
node_color: "Union[Sequence[str], str]"
131133
if group_by_process_name is not None:
132134
node_color = list(
133135
map(
@@ -138,7 +140,7 @@ def draw_tree(
138140
)
139141
)
140142
else:
141-
node_color = None
143+
node_color = OTHER_COLOR
142144
nx.draw_networkx(
143145
pids_tree,
144146
pos=pos,
@@ -194,6 +196,7 @@ def draw_spiral(
194196
ax.margins(0)
195197
plt.axis("off")
196198

199+
node_color: "Union[Sequence[str], str]"
197200
if group_by_process_name is not None:
198201
node_color = list(
199202
map(
@@ -204,7 +207,7 @@ def draw_spiral(
204207
)
205208
)
206209
else:
207-
node_color = None
210+
node_color = OTHER_COLOR
208211
nx.draw_networkx(
209212
pids_tree,
210213
pos=pos,

mypy-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ types-psutil
33
pandas-stubs
44
types-networkx
55
types-setuptools
6+
typing_extensions

0 commit comments

Comments
 (0)