Skip to content

Rename internal strings accessor module to match runtime #1295

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

Merged
merged 1 commit into from
Jul 27, 2025

Conversation

hamdanal
Copy link
Contributor

This is a simple rename of the internal strings accessor module to match the runtime module name for the following reasons:

For users:

  • This fixes editors like VS Code not displaying the documentation of the methods like series.str.replace on hover because they couldn't match the runtime docstring to the stub which was living in a different module
  • The additional nesting (pandas.core.strings.accessor instead of pandas.core.strings) makes it less desirable for users to reach out to the class that is not considered public api

For the stubs developers:

  • When working on the stubs, having the name matching runtime makes it easier to navigate between the source and the stubs in an IDE as the "Go to definition" and "Go to type definition" actions now work correctly
  • If and when you start using stubtest as part of your infrastructure, this is one less module to worry about as stubtest will not complain about a missing stub and a non-existent runtime

@hamdanal
Copy link
Contributor Author

This is how VS Code with Pylance is able to display documentation on hover now
image

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

Thanks @hamdanal

@Dr-Irv Dr-Irv merged commit 4f0c41d into pandas-dev:main Jul 27, 2025
13 checks passed
@hamdanal hamdanal deleted the strings-accessor branch July 28, 2025 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants