File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/python/plotly/plotly/express Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1331,6 +1331,9 @@ def build_dataframe(args, constructor):
1331
1331
elif hasattr (args ["data_frame" ], "to_pandas" ):
1332
1332
args ["data_frame" ] = args ["data_frame" ].to_pandas ()
1333
1333
columns = args ["data_frame" ].columns
1334
+ elif hasattr (args ["data_frame" ], "toPandas" ):
1335
+ args ["data_frame" ] = args ["data_frame" ].toPandas ()
1336
+ columns = args ["data_frame" ].columns
1334
1337
else :
1335
1338
args ["data_frame" ] = pd .DataFrame (args ["data_frame" ])
1336
1339
columns = args ["data_frame" ].columns
@@ -1425,9 +1428,14 @@ def build_dataframe(args, constructor):
1425
1428
# def __dataframe__(self, ...):
1426
1429
# if not some_condition:
1427
1430
# self.to_pandas(...)
1428
- if not hasattr (df_not_pandas , "to_pandas" ):
1431
+ if not hasattr (df_not_pandas , "to_pandas" ) or hasattr (
1432
+ df_not_pandas , "toPandas"
1433
+ ):
1429
1434
raise exc
1430
- args ["data_frame" ] = df_not_pandas .to_pandas ()
1435
+ if hasattr (df_not_pandas , "toPandas" ):
1436
+ args ["data_frame" ] = df_not_pandas .toPandas ()
1437
+ else :
1438
+ args ["data_frame" ] = df_not_pandas .to_pandas ()
1431
1439
1432
1440
df_input = args ["data_frame" ]
1433
1441
You can’t perform that action at this time.
0 commit comments