Skip to content

Commit 00a745c

Browse files
authored
Update dashboard_helper.py
use a copy of attribute_option_candidates in functions
1 parent 576f304 commit 00a745c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

maro/cli/inspector/dashboard_helper.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT license.
33

4+
import copy
45
import math
56
from typing import List
67

@@ -206,10 +207,10 @@ def _get_attribute_option(
206207
if scenario == GlobalScenarios.CITI_BIKE:
207208
for item in attribute_option:
208209
if item == "All":
209-
attribute_option_candidates.remove("All")
210-
attribute_option_candidates.remove("Requirement Info")
211-
attribute_option_candidates.remove("Station Info")
212-
attribute_option_res = attribute_option_candidates
210+
attribute_option_res = copy.deepcopy(attribute_option_candidates)
211+
attribute_option_res.remove("All")
212+
attribute_option_res.remove("Requirement Info")
213+
attribute_option_res.remove("Station Info")
213214
break
214215
elif item == "Requirement Info":
215216
attribute_option_res = attribute_option_res + CITIBIKEItemOption.requirement_info
@@ -222,10 +223,10 @@ def _get_attribute_option(
222223
if scenario == GlobalScenarios.CIM:
223224
for item in attribute_option:
224225
if item == "All":
225-
attribute_option_candidates.remove("All")
226-
attribute_option_candidates.remove("Booking Info")
227-
attribute_option_candidates.remove("Port Info")
228-
attribute_option_res = attribute_option_candidates
226+
attribute_option_res = copy.deepcopy(attribute_option_candidates)
227+
attribute_option_res.remove("All")
228+
attribute_option_res.remove("Booking Info")
229+
attribute_option_res.remove("Port Info")
229230
break
230231
elif item == "Booking Info":
231232
attribute_option_res = attribute_option_res + CIMItemOption.booking_info

0 commit comments

Comments
 (0)