We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 688fe67 commit 6be6284Copy full SHA for 6be6284
1 file changed
plotly/figure_factory/_gantt.py
@@ -32,12 +32,12 @@ def validate_gantt(df):
32
"""
33
if pd and isinstance(df, pd.core.frame.DataFrame):
34
# 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
- )
+ for key in REQUIRED_GANTT_KEYS:
+ if key not in df:
+ raise exceptions.PlotlyError(
+ "The columns in your dataframe must include the "
+ "following keys: {0}".format(", ".join(REQUIRED_GANTT_KEYS))
+ )
41
42
# Pre-fetch columns as DataFrames Series to minimize iloc lookups
43
# This turns each key into a reference to the Series, for quick access
0 commit comments