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

add json_path_match/2 #859

Merged
merged 3 commits into from Feb 15, 2024
Merged

Conversation

lkarthee
Copy link
Member

s = Explorer.Series.from_list([~s({"a": 1}), ~s({"b": 1})])
#Explorer.Series<
  Polars[2]
  string ["{\"a\": 1}", "{\"b\": 1}"]
>
iex(3)> Explorer.Series.json_path_match(s, "$.a")
#Explorer.Series<
  Polars[2]
  string ["1", nil]
>
iex(4)> Explorer.Series.json_path_match(s, "$.")
** (RuntimeError) Polars Error: ComputeError(ErrString("error compiling JSONpath expression path error: \nEof\n"))
    (explorer 0.9.0-dev) lib/explorer/polars_backend/shared.ex:26: Explorer.PolarsBackend.Shared.apply_series/3
    iex:4: (file)

Copy link
Member

@josevalim josevalim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lkarthee lkarthee force-pushed the json_path_match branch 2 times, most recently from fbfb2b6 to e3e1ef3 Compare February 15, 2024 12:39
@lkarthee
Copy link
Member Author

added docs and tests

lib/explorer/series.ex Outdated Show resolved Hide resolved
lib/explorer/series.ex Outdated Show resolved Hide resolved
lkarthee and others added 2 commits February 15, 2024 22:19
Co-authored-by: José Valim <jose.valim@gmail.com>
@lkarthee
Copy link
Member Author

random ci failure - mix format failure is due some other reason..

@josevalim josevalim merged commit 8e6546b into elixir-explorer:main Feb 15, 2024
3 of 4 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@lkarthee lkarthee deleted the json_path_match branch February 16, 2024 00:03
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

Successfully merging this pull request may close these issues.

None yet

2 participants