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

DSGN: Allow functional definitions of custom nodes #1639

Closed
cpcloud opened this issue Sep 27, 2018 · 2 comments
Closed

DSGN: Allow functional definitions of custom nodes #1639

cpcloud opened this issue Sep 27, 2018 · 2 comments

Comments

@cpcloud
Copy link
Member

cpcloud commented Sep 27, 2018

In #1637, the idea of being able to define your own nodes using decorators came up.

For example (and I'm speculating here),

@postgres.udf([dt.double, dt.double], dt.double)
def my_node(x, y, **kwargs):
    return # things in the "space" of the backend, in this case, it would be SQLAlchemy code

We should think through what this would look like and discuss any relevant details.

@scottcode
Copy link
Contributor

I independently started work on this type of functionality. I didn't follow that API pattern, but I like the decorator style you showed, @cpcloud. If you or anyone else gets a chance, please take a look at my feature branch below and let me know what you think.

https://github.com/scottcode/ibis/tree/pg_udf

One thing that is lacking in the CI suite to make Postgres UDF testing feasible is that the current Postgres image being used doesn't have PL/Python installed. It's using an image that is a much slimmed-down version of Postgres. The easiest fix is to use the standard full version of Postgres. I'm working on creating a new Dockerfile that achieves that, but I haven't got it working yet and haven't pushed any code on that yet.

@scottcode
Copy link
Contributor

I broke out the Docker image for Postgres supporting PL/Python as a separate issue: #1853

@cpcloud cpcloud closed this as completed Dec 16, 2021
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

No branches or pull requests

2 participants