Skip to content

Commit 2a409f1

Browse files
committed
Update _core.py
1 parent 9b03201 commit 2a409f1

File tree

1 file changed

+3
-7
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+3
-7
lines changed

Diff for: packages/python/plotly/plotly/express/_core.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -1431,18 +1431,14 @@ def build_dataframe(args, constructor):
14311431
# def __dataframe__(self, ...):
14321432
# if not some_condition:
14331433
# self.to_pandas(...)
1434-
if not (
1435-
hasattr(df_not_pandas, "to_pandas")
1436-
or hasattr(df_not_pandas, "toPandas")
1437-
or hasattr(df_not_pandas, "to_pandas_df")
1438-
):
1439-
raise exc
14401434
if hasattr(df_not_pandas, "toPandas"):
14411435
args["data_frame"] = df_not_pandas.toPandas()
14421436
elif hasattr(df_not_pandas, "to_pandas_df"):
14431437
args["data_frame"] = df_not_pandas.to_pandas_df()
1444-
else:
1438+
elif hasattr(df_not_pandas, "to_pandas"):
14451439
args["data_frame"] = df_not_pandas.to_pandas()
1440+
else:
1441+
raise exc
14461442

14471443
df_input = args["data_frame"]
14481444

0 commit comments

Comments
 (0)