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

feat(python): warn about inefficient apply json.loads if json is local import #10310

Merged
merged 1 commit into from
Aug 5, 2023

Conversation

MarcoGorelli
Copy link
Collaborator

The following doesn't raise on main:

def func():
    import json

    df = pl.DataFrame({'a': '{"a":[1,2,3]}'}).select(pl.col('a').apply(lambda x: json.loads(x)))


func()

@MarcoGorelli MarcoGorelli marked this pull request as draft August 5, 2023 09:23
@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Aug 5, 2023
@MarcoGorelli MarcoGorelli marked this pull request as ready for review August 5, 2023 09:25
@alexander-beedie
Copy link
Collaborator

alexander-beedie commented Aug 5, 2023

Nicely done; very clean :)

@alexander-beedie alexander-beedie merged commit 82c1685 into pola-rs:main Aug 5, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants