Skip to content

Conversation

@lucaslarios
Copy link

@lucaslarios lucaslarios commented Nov 16, 2022

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

@property def _constructor_expanddim( self ): return DataFrame 

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)

Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, please always add tests

@lucaslarios
Copy link
Author

Hey, please always add tests

is there any documentation explaining the requested test patterns?

@phofl
Copy link
Member

phofl commented Nov 16, 2022

You can check the contributor guide, testing is explained there as well

https://pandas.pydata.org/docs/dev/development/contributing.html

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Nov 16, 2022
@lucaslarios
Copy link
Author

lucaslarios commented Dec 13, 2022

Tests have been added @phofl

@lucaslarios
Copy link
Author

lucaslarios commented Dec 22, 2022

Still relevant? @phofl @jreback

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jan 22, 2023
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale Testing pandas testing functions or related to the test suite

3 participants