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

function module in python binding is broken in 6.0 #1328

Closed
jimexist opened this issue Nov 18, 2021 · 7 comments
Closed

function module in python binding is broken in 6.0 #1328

jimexist opened this issue Nov 18, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@jimexist
Copy link
Member

jimexist commented Nov 18, 2021

Describe the bug

the function module in python binding is broken in 6.0

To Reproduce

In [1]: import datafusion
f
In [2]: from datafusion import functions

In [3]: dir(functions)
Out[3]:
['__builtins__',
 '__cached__',
 '__doc__',
 '__file__',
 '__getattr__',
 '__loader__',
 '__name__',
 '__package__',
 '__spec__',
 'functions']

Expected behavior

expect the function module to be only one level below Datafusion.

Additional context

related

  1. Rework the python bindings [WIP] #856
  2. Rework the python bindings using conversion traits from arrow-rs  #873
@jimexist jimexist added the bug Something isn't working label Nov 18, 2021
@houqp
Copy link
Member

houqp commented Nov 18, 2021

@jimexist this was intentional, see #1287 (comment).

@houqp
Copy link
Member

houqp commented Nov 18, 2021

I don't have a strong opinion on this though, if you think there is a valid use-case for having the functions module, we can add it back.

@houqp
Copy link
Member

houqp commented Nov 18, 2021

#1287 (comment) is the comment that made me change my mind on my original PR :)

@jimexist
Copy link
Member Author

jimexist commented Nov 18, 2021

I don't have a strong opinion on this though, if you think there is a valid use-case for having the functions module, we can add it back.

so you are saying that we should use:

 from datafusion.functions import functions as f

instead of

 from datafusion import functions as f

having two layers of functions is unintuitive

@jimexist
Copy link
Member Author

ah I see now that I can do

from datafusion.functions import md5

@houqp
Copy link
Member

houqp commented Nov 18, 2021

from datafusion import functions as f should still work, it's just that datafusion.functions won't work anymore.

@houqp
Copy link
Member

houqp commented Nov 18, 2021

oh, i see what confused you. yeah, it would be better if dir works with functions module :(

@jimexist jimexist closed this as completed Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants