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

Polars plugins should be referenced by .venv relative path #21643

Open
2 tasks done
mat-ej opened this issue Mar 7, 2025 · 3 comments
Open
2 tasks done

Polars plugins should be referenced by .venv relative path #21643

mat-ej opened this issue Mar 7, 2025 · 3 comments
Labels
accepted Ready for implementation bug Something isn't working good first issue Good for newcomers python Related to Python Polars

Comments

@mat-ej
Copy link

mat-ej commented Mar 7, 2025

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

Hi Polars team and community, thanks in advance for your advice.

pls see below screenshot output of the show_graph(),

Example using polars-ds:

import polars as pl
import polars_ds as pds

pds.lin_reg(
        pl.col("x1"), pl.col("x2"),
        target = [pl.col("y"), pl.col("y2")],
        add_bias=False
).meta.show_graph()
Image

Log output

Issue description

when using custom polars plugins inside Pl.Expr expression, the node uses absolute system path to point to a rust lib to do the operation. (This causes confusing behaviour when serializing such expressions)

Expected behavior

It would be a lot more practical if when serializing pl.Expr graph, such node pointed to a relative path to .venv instead of absolute path. I believe this would make the code portable from one .venv to another if the versions match. (Correct me If I m wrong)

Installed versions

polars: 1.22.0
polars-ds: 0.8.2

@mat-ej mat-ej added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Mar 7, 2025
@mat-ej mat-ej changed the title Polars plugins should be referened by .venv relative path Polars plugins should be referenced by .venv relative path Mar 7, 2025
@ritchie46
Copy link
Member

Yes, that's also something we discussed internally to make it work for Polars cloud. This can be resolved completely in Python.

Any help here would be appreciated.

@coastalwhite coastalwhite added good first issue Good for newcomers accepted Ready for implementation and removed needs triage Awaiting prioritization by a maintainer labels Mar 7, 2025
@anath2
Copy link

anath2 commented Mar 8, 2025

Hi, I would like to work on this issue

@mat-ej
Copy link
Author

mat-ej commented Mar 9, 2025

Feel free to take it, I am still trying to allocate time for going through polars code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation bug Something isn't working good first issue Good for newcomers python Related to Python Polars
Projects
None yet
Development

No branches or pull requests

4 participants