-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Python] Improve usability of pc.map_lookup / MapLookupOptions #36045
Comments
Actually, that errors only because I mis-spelled the keyword name. With the correct name it works:
Wondering if we can provide a better error message in that case, but that might just be a Python/cython behaviour of first checking the positional keywords before the named ones) |
Yes, that's a cython issue -> cython/cython#1281 |
So, we should only handle the issue one. I can make a quick implementation for it |
take |
…ns (#36387) ### Rationale for this change This PR is for #36045, which aims to improve usability of pc.map_lookup / MapLookupOptions ### What changes are included in this PR? For `query_key` which is not a subclass of `pyarrow.lib.Scalar`, we convert it to `scalar` ### Are these changes tested? Yes, add one test in tests/test_compute.py::test_map_lookup * Closes: #36045 Lead-authored-by: Junming Chen <junming.chen.r@outlook.com> Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Trying to use
pc.map_lookup
today, I noticed some minor usability issues that could be improved:1. Passing the key value as a python string instead of scalar errors:
If not passing a Scalar object, we should probably just pass the python value to
pa.scalar(..)
for convenience.2. Allow to specify the
occurence
keyword, given that this is not necessarily obvious, it's nice to be able to specify the named argument:I suppose we need to give it a default value for this, though (to make our auto-generation work, or we can look into improving the autogeneration of the signature)
The text was updated successfully, but these errors were encountered: