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

Generalize the type of the input to rename from dict to mapping #19400

Open
DavideCanton opened this issue Oct 23, 2024 · 2 comments · May be fixed by #19436
Open

Generalize the type of the input to rename from dict to mapping #19400

DavideCanton opened this issue Oct 23, 2024 · 2 comments · May be fixed by #19436
Labels
enhancement New feature or an improvement of an existing feature good first issue Good for newcomers

Comments

@DavideCanton
Copy link

Description

Not really sure if this should be a feature request, but it seems the closest one to what I'm proposing.

Now the rename function accepts a dict[str, str], is it feasible to generalize it to accept Mapping[str, str] instead?

In many places I tend to use mapping as it is readonly and avoids passing mutable structures around, but each time I have to invoke df.rename I have to do df.rename(dict(mapping)) that feels redundant.

@DavideCanton DavideCanton added the enhancement New feature or an improvement of an existing feature label Oct 23, 2024
@alexander-beedie
Copy link
Collaborator

Doesn't sound unreasonable; want to make a PR? :)

@alexander-beedie alexander-beedie added the good first issue Good for newcomers label Oct 23, 2024
@DavideCanton
Copy link
Author

Sure, I'll try when I have some time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants