Skip to content

Python: adds JSON.ARRLEN command#2403

Merged
shohamazon merged 2 commits intorelease-1.2from
json.arrlen
Oct 10, 2024
Merged

Python: adds JSON.ARRLEN command#2403
shohamazon merged 2 commits intorelease-1.2from
json.arrlen

Conversation

@shohamazon
Copy link
Copy Markdown
Collaborator

No description provided.

@shohamazon shohamazon requested a review from a team as a code owner October 8, 2024 09:31
@shohamazon shohamazon added the python 🐍 Python wrapper label Oct 8, 2024
For JSONPath (`path` starts with `$`):
Returns a list of integer replies for every possible path, indicating the length of the array,
or None for JSON values matching the path that are not an array.
If `path` doen't exist, an empty array will be returned.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
If `path` doen't exist, an empty array will be returned.
If `path` doesn't exist, an empty array will be returned.

Copy link
Copy Markdown

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

Add a changelog

assert await json.arrlen(glide_client, key, "$..a") == [3, 2, None]

# Legacy path retrieves the first array match at ..a
assert await json.arrlen(glide_client, key, "..a") == 3
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test without path arg

"""
Retrieves the length of the array at the specified `path` within the JSON document stored at `key`.

See https://valkey.io/commands/json.arrlen/ for more details.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove the link. We can add valid links later once docs published

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I will remove them all

@shohamazon
Copy link
Copy Markdown
Collaborator Author

Add a changelog

Thanks, I'm adding it in the end because changelog is edited quite often so there are lots of conflicts

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
@shohamazon shohamazon merged commit fcc6001 into release-1.2 Oct 10, 2024
@shohamazon shohamazon deleted the json.arrlen branch October 10, 2024 13:09
@shohamazon shohamazon mentioned this pull request Oct 10, 2024
22 tasks
cyip10 pushed a commit that referenced this pull request Oct 11, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: Chloe <chloe.yip@improving.com>
mo-amzn pushed a commit that referenced this pull request Oct 14, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
mo-amzn pushed a commit to mo-amzn/valkey-glide that referenced this pull request Oct 15, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: Muhammad Awawdi <Mawawdi@amazon.com>
avifenesh pushed a commit to avifenesh/valkey-glide that referenced this pull request Oct 21, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh pushed a commit to avifenesh/valkey-glide that referenced this pull request Oct 21, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh pushed a commit that referenced this pull request Oct 22, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh pushed a commit to avifenesh/valkey-glide that referenced this pull request Oct 22, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>
avifenesh pushed a commit that referenced this pull request Oct 22, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>
mo-amzn pushed a commit to mo-amzn/valkey-glide that referenced this pull request Oct 22, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh pushed a commit that referenced this pull request Oct 22, 2024
---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>
avifenesh added a commit that referenced this pull request Oct 22, 2024
* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh added a commit to avifenesh/valkey-glide that referenced this pull request Nov 3, 2024
* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (valkey-io#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (valkey-io#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh added a commit to avifenesh/valkey-glide that referenced this pull request Nov 3, 2024
* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (valkey-io#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (valkey-io#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh added a commit to avifenesh/valkey-glide that referenced this pull request Nov 3, 2024
* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (valkey-io#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (valkey-io#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh added a commit to avifenesh/valkey-glide that referenced this pull request Nov 5, 2024
* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (valkey-io#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (valkey-io#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh added a commit to avifenesh/valkey-glide that referenced this pull request Nov 5, 2024
* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (valkey-io#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (valkey-io#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh added a commit to avifenesh/valkey-glide that referenced this pull request Nov 5, 2024
* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (valkey-io#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (valkey-io#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
avifenesh added a commit that referenced this pull request Nov 5, 2024
* Update README.md nodejs platform support (#2397)

* Update README.md

Signed-off-by: Avi Fenesh <55848801+avifenesh@users.noreply.github.com>

* Update README.md - lint fix

Signed-off-by: Avi Fenesh <55848801+avifenesh@users.noreply.github.com>

* Update README.md ling

Signed-off-by: Avi Fenesh <55848801+avifenesh@users.noreply.github.com>

* Update node/README.md

Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Avi Fenesh <55848801+avifenesh@users.noreply.github.com>

---------

Signed-off-by: Avi Fenesh <55848801+avifenesh@users.noreply.github.com>
Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* CI - Minimal and full CI matrix impl (#2051)

* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>

* CI - Minimal and full CI matrix impl (#2051)

* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>

* CI - Minimal and full CI matrix impl (#2051)

* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>

* Fix for - Minimal and full CI matrix impl #2051 (#2500)

* Refactor tests to use async cleanup and improve error handling

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Enhance Jest configuration and add test setup file; update build scripts and dependencies

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Update devDependencies in package.json for hybrid-node-tests to latest versions

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Enhance test utilities and command tests with improved wait logic and version checks

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Refactor tests to assert expected replica reads are less than or equal to actual reads; update connection handling in utilities and allow unused imports in types

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Update dependencies and enhance PyO3 bindings; add new features and improve type handling

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Update GitHub workflows: enhance linting configurations, adjust engine version requirements, and remove obsolete Redis installation workflow

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* fixes for CI (#2552)

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Refactor CI configuration for consistency and clarity

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Refactor CI configuration for consistency and clarity

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: Avi Fenesh <55848801+avifenesh@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
acarbonetto pushed a commit that referenced this pull request Nov 5, 2024
* CI - Minimal and full CI matrix impl

Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Fix mypy failing (#2453)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

* Python: adds JSON.ARRLEN command (#2403)

---------

Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: avifenesh <aviarchi1994@gmail.com>

---------

Signed-off-by: avifenesh <aviarchi1994@gmail.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python 🐍 Python wrapper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants