Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test dir of pandas.api.* #52826

Merged
merged 5 commits into from
Apr 23, 2023
Merged

Conversation

SecretLake
Copy link
Contributor

@SecretLake SecretLake commented Apr 21, 2023

@rhshadrach Could you please review this PR?

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Apr 21, 2023
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good - some minor requests.

@@ -17,10 +23,12 @@ def check(self, namespace, expected, ignored=None):
result = sorted(
f for f in dir(namespace) if not f.startswith("__") and f != "annotations"
)

Copy link
Member

Choose a reason for hiding this comment

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

Can you remove this added line. I think the code is fine either way (someone could argue to remove the blank lines with the justification that they unnecessarily use up vertical space), and in such cases it's best to leave as-is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely, thank you for the review. Implemented all the changes.

if ignored is not None:
result = sorted(set(result) - set(ignored))

expected = sorted(expected)

Copy link
Member

Choose a reason for hiding this comment

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

Same

@@ -237,8 +245,14 @@ def test_depr(self):


class TestApi(Base):
allowed = ["types", "extensions", "indexers", "interchange", "typing"]
allowed_typing = [
allowed_api_dirs: list[str] = [
Copy link
Member

Choose a reason for hiding this comment

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

By-and-large, we do not type-hint test code. I think we should keep the status-quo here unless an explicit decision is made to add type-hints. Can you remove throughout.

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

lgtm

@rhshadrach rhshadrach added this to the 2.1 milestone Apr 23, 2023
@rhshadrach rhshadrach merged commit 4dd071e into pandas-dev:main Apr 23, 2023
26 of 32 checks passed
@rhshadrach
Copy link
Member

Thanks @SecretLake!

Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: Test dir of pandas.api.*
3 participants