File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 77
77
validate_all_hashable ,
78
78
)
79
79
from pandas .core .dtypes .dtypes import (
80
- ArrowDtype ,
81
80
CategoricalDtype ,
82
81
ExtensionDtype ,
83
82
SparseDtype ,
@@ -586,13 +585,9 @@ def __arrow_c_stream__(self, requested_schema=None):
586
585
if requested_schema is not None
587
586
else None
588
587
)
589
- if isinstance (self .dtype , ArrowDtype ):
590
- # fastpath!
591
- ca = self .values ._pa_array
592
- if type is not None :
593
- ca = ca .cast (type )
594
- else :
595
- ca = pa .chunked_array ([pa .Array .from_pandas (self , type = type )])
588
+ ca = pa .array (self , type = type )
589
+ if not isinstance (ca , pa .ChunkedArray ):
590
+ ca = pa .chunked_array ([ca ])
596
591
return ca .__arrow_c_stream__ ()
597
592
598
593
# ----------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments