An optional parameter called check_series_type was created #49721
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
An optional parameter called check_series_type was created in the assert_frame_equal function which solves the problem passed by issue #48287.
By default the parameter is set to True, however it is now its possible to set it to False and skip series_type_check.
Example:
import pandas as pd
class Series(pd.Series):
@Property
def _constructor( self ):
return Series
class DataFrame(pd.DataFrame):
@Property
def _constructor_sliced( self ):
return Series
s1 = pd.Series( [0] )
s2 = Series( s1 )
pd.testing.assert_series_equal(s1, s2, check_series_type=False)
df1 = s1.to_frame()
df2 = s2.to_frame()
pd.testing.assert_frame_equal(df1, df2, check_frame_type=False,check_series_type=False)