Skip to content

GH1173 Experiment with fuller typing #1193

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

loicdiridollou
Copy link
Contributor

@MarcoGorelli I took a try at your idea of typehinting the whole set of arguments in pd.DataFrame.query but stumbling upon the issue when the user passes a dictionary (which is still an allowed behavior).
Wondering if there is something I am missing here, please let me know!

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Apr 21, 2025

@MarcoGorelli I took a try at your idea of typehinting the whole set of arguments in pd.DataFrame.query but stumbling upon the issue when the user passes a dictionary (which is still an allowed behavior).
Wondering if there is something I am missing here, please let me know!

You'd still need to have the **kwargs as an overload. If you want to allow the other arguments, you can have that (although I don't think we should do that because it's not documented), but you'd still need the **kwargs overload

Comment on lines +679 to +685
parser: Literal["pandas", "python"] = ...,
engine: Literal["python", "numexpr"] | None = ...,
local_dict: dict[_str, Any] | None = ...,
global_dict: dict[_str, Any] | None = ...,
resolvers: list[Mapping] | None = ...,
level: int = ...,
target: object | None = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you indicate where you found this list of possible keyword arguments?

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.

type kwargs in DataFrame.query according to DataFrame.eval
2 participants