@@ -954,15 +954,15 @@ def __str__(self):
954954 def __repr__ (self ):
955955 return self ._to_str (representation = True )
956956
957- def _to_arr (self ):
957+ def _to_arr (self , dtype = None , copy = None ):
958958 if len (self ._executed_sessions ) == 0 : # pragma: no cover
959959 raise NotImplementedError
960960
961961 data = self .fetch (session = self ._executed_sessions [- 1 ])
962- return np .asarray (data )
962+ return np .asarray (data , dtype = dtype , copy = copy )
963963
964- def __array__ (self ):
965- return self ._to_arr ()
964+ def __array__ (self , dtype = None , copy = None ):
965+ return self ._to_arr (dtype = dtype , copy = copy )
966966
967967 def _to_mars_tensor (self , dtype = None , order = "K" , extract_multi_index = False ):
968968 tensor = self .to_tensor (extract_multi_index = extract_multi_index )
@@ -1455,15 +1455,15 @@ def __str__(self):
14551455 def __repr__ (self ):
14561456 return self ._to_str (representation = False )
14571457
1458- def _to_arr (self ):
1458+ def _to_arr (self , dtype = None , copy = None ):
14591459 if len (self ._executed_sessions ) == 0 : # pragma: no cover
14601460 raise NotImplementedError
14611461
14621462 data = self .fetch (session = self ._executed_sessions [- 1 ])
1463- return np .asarray (data )
1463+ return np .asarray (data , dtype = dtype , copy = copy )
14641464
1465- def __array__ (self ):
1466- return self ._to_arr ()
1465+ def __array__ (self , dtype = None , copy = None ):
1466+ return self ._to_arr (dtype = dtype , copy = copy )
14671467
14681468 @property
14691469 def dtype (self ):
@@ -2054,9 +2054,9 @@ class BaseDataFrameData(HasShapeTileableData, _ToPandasMixin):
20542054 "chunks" ,
20552055 FieldTypes .reference (DataFrameChunkData ),
20562056 on_serialize = lambda x : [it .data for it in x ] if x is not None else x ,
2057- on_deserialize = lambda x : [ DataFrameChunk ( it ) for it in x ]
2058- if x is not None
2059- else x ,
2057+ on_deserialize = lambda x : (
2058+ [ DataFrameChunk ( it ) for it in x ] if x is not None else x
2059+ ) ,
20602060 )
20612061
20622062 def __init__ (
@@ -2263,15 +2263,15 @@ def _to_str(self, representation=False):
22632263 def __str__ (self ):
22642264 return self ._to_str (representation = False )
22652265
2266- def _to_arr (self ):
2266+ def _to_arr (self , dtype = None , copy = None ):
22672267 if len (self ._executed_sessions ) == 0 :
22682268 raise NotImplementedError
22692269
22702270 data = self .fetch (session = self ._executed_sessions [- 1 ])
2271- return np .asarray (data )
2271+ return np .asarray (data , dtype = dtype , copy = copy )
22722272
2273- def __array__ (self ):
2274- return self ._to_arr ()
2273+ def __array__ (self , dtype = None , copy = None ):
2274+ return self ._to_arr (dtype = dtype , copy = copy )
22752275
22762276 def __repr__ (self ):
22772277 return self ._to_str (representation = True )
@@ -2767,9 +2767,9 @@ class DataFrameGroupByData(BaseDataFrameData):
27672767 "chunks" ,
27682768 FieldTypes .reference (DataFrameGroupByChunkData ),
27692769 on_serialize = lambda x : [it .data for it in x ] if x is not None else x ,
2770- on_deserialize = lambda x : [ DataFrameGroupByChunk ( it ) for it in x ]
2771- if x is not None
2772- else x ,
2770+ on_deserialize = lambda x : (
2771+ [ DataFrameGroupByChunk ( it ) for it in x ] if x is not None else x
2772+ ) ,
27732773 )
27742774
27752775 @property
@@ -2816,9 +2816,9 @@ class SeriesGroupByData(BaseSeriesData):
28162816 "chunks" ,
28172817 FieldTypes .reference (SeriesGroupByChunkData ),
28182818 on_serialize = lambda x : [it .data for it in x ] if x is not None else x ,
2819- on_deserialize = lambda x : [ SeriesGroupByChunk ( it ) for it in x ]
2820- if x is not None
2821- else x ,
2819+ on_deserialize = lambda x : (
2820+ [ SeriesGroupByChunk ( it ) for it in x ] if x is not None else x
2821+ ) ,
28222822 )
28232823
28242824 @property
@@ -2995,9 +2995,9 @@ class CategoricalData(HasShapeTileableData, _ToPandasMixin):
29952995 "chunks" ,
29962996 FieldTypes .reference (CategoricalChunkData ),
29972997 on_serialize = lambda x : [it .data for it in x ] if x is not None else x ,
2998- on_deserialize = lambda x : [ CategoricalChunk ( it ) for it in x ]
2999- if x is not None
3000- else x ,
2998+ on_deserialize = lambda x : (
2999+ [ CategoricalChunk ( it ) for it in x ] if x is not None else x
3000+ ) ,
30013001 )
30023002
30033003 def __init__ (
@@ -3195,9 +3195,9 @@ class DataFrameOrSeriesData(HasShapeTileableData, _ToPandasMixin):
31953195 "chunks" ,
31963196 FieldTypes .reference (DataFrameOrSeriesChunkData ),
31973197 on_serialize = lambda x : [it .data for it in x ] if x is not None else x ,
3198- on_deserialize = lambda x : [ DataFrameOrSeriesChunk ( it ) for it in x ]
3199- if x is not None
3200- else x ,
3198+ on_deserialize = lambda x : (
3199+ [ DataFrameOrSeriesChunk ( it ) for it in x ] if x is not None else x
3200+ ) ,
32013201 )
32023202
32033203 _data_type = StringField ("data_type" )
0 commit comments