Skip to content

Commit 6be6284

Browse files
Apply suggestion from @misrasaurabh1
1 parent 688fe67 commit 6be6284

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plotly/figure_factory/_gantt.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ def validate_gantt(df):
3232
"""
3333
if pd and isinstance(df, pd.core.frame.DataFrame):
3434
# validate that df has all the required keys
35-
missing_keys = [key for key in REQUIRED_GANTT_KEYS if key not in df]
36-
if missing_keys:
37-
raise exceptions.PlotlyError(
38-
"The columns in your dataframe must include the "
39-
"following keys: {0}".format(", ".join(REQUIRED_GANTT_KEYS))
40-
)
35+
for key in REQUIRED_GANTT_KEYS:
36+
if key not in df:
37+
raise exceptions.PlotlyError(
38+
"The columns in your dataframe must include the "
39+
"following keys: {0}".format(", ".join(REQUIRED_GANTT_KEYS))
40+
)
4141

4242
# Pre-fetch columns as DataFrames Series to minimize iloc lookups
4343
# This turns each key into a reference to the Series, for quick access

0 commit comments

Comments
 (0)