File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ def tile(cls, op: 'DataFrameDrop'):
117
117
col_to_args [c .index [1 ]] = (new_dtypes , new_col_id )
118
118
119
119
params .update (dict (dtypes = new_dtypes , index = (c .index [0 ], new_col_id ),
120
- index_value = parse_index ( None , ( c . key , c . index_value . key )) ))
120
+ index_value = c . index_value ))
121
121
if op .index is not None :
122
122
params .update (dict (shape = (np .nan , len (new_dtypes )),
123
123
index_value = parse_index (None , (c .key , c .index_value .key ))))
Original file line number Diff line number Diff line change @@ -785,13 +785,25 @@ def testDrop(self):
785
785
raw = pd .DataFrame (rs .randint (1000 , size = (20 , 8 )),
786
786
columns = ['c' + str (i + 1 ) for i in range (8 )])
787
787
788
- df = from_pandas_df (raw , chunk_size = 3 )
788
+ df = from_pandas_df (raw , chunk_size = 8 )
789
789
790
790
with self .assertRaises (KeyError ):
791
791
df .drop (columns = ['c9' ])
792
792
with self .assertRaises (NotImplementedError ):
793
793
df .drop (columns = from_pandas_series (pd .Series (['c9' ])))
794
794
795
+ r = df .drop (columns = ['c1' ])
796
+ pd .testing .assert_index_equal (r .index_value .to_pandas (), raw .index )
797
+
798
+ tiled = r .tiles ()
799
+ start = 0
800
+ for c in tiled .chunks :
801
+ raw_index = raw .index [start : start + c .shape [0 ]]
802
+ start += c .shape [0 ]
803
+ pd .testing .assert_index_equal (raw_index , c .index_value .to_pandas ())
804
+
805
+ df = from_pandas_df (raw , chunk_size = 3 )
806
+
795
807
columns = ['c2' , 'c4' , 'c5' , 'c6' ]
796
808
index = [3 , 6 , 7 ]
797
809
r = df .drop (columns = columns , index = index )
You can’t perform that action at this time.
0 commit comments