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

ARROW-11342: [Python] [Gandiva] Expose ToString and result type information #9288

Closed
wants to merge 3 commits into from

Conversation

wjones127
Copy link
Member

These methods are intended to make it easier to work with and debug the Gandiva expression builder.

import pyarrow
import pyarrow.gandiva as gandiva

builder = gandiva.TreeExprBuilder()

lit = builder.make_literal(1000.0, pyarrow.float64())
print(lit)
# Before: <pyarrow.gandiva.Node object at 0x7f36fd37ecf0>
# After: (const double) 1000 raw(408f400000000000)

field = builder.make_field(pyarrow.field('a', pyarrow.float64()))
print(field)
# Before: <pyarrow.gandiva.Node object at 0x7ff7daf99f90>
# After: (double) a

print(builder.make_function('greater_than', [field, lit], pyarrow.bool_()))
# Before: <pyarrow.gandiva.Node object at 0x7ff7d24bde70>
# After: bool greater_than((double) a, (const double) 1000 raw(408f400000000000))

@github-actions
Copy link

@emkornfield
Copy link
Contributor

@wjones127 sorry for the late review. This looks OK to me, did you want to add specific tests asserting equality to strings?

@wjones127
Copy link
Member Author

@wjones127 sorry for the late review. This looks OK to me, did you want to add specific tests asserting equality to strings?

Yup that makes sense. I will add that.

@pitrou
Copy link
Member

pitrou commented Jun 23, 2021

@wjones127 Really sorry for the delay :-/. I rebased on git master and will merge if CI is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants