-
Notifications
You must be signed in to change notification settings - Fork 51
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 order_by
and descending
options to scan and fetch_all queries
#291
✨ add order_by
and descending
options to scan and fetch_all queries
#291
Conversation
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
f8bddd4
to
d338cc0
Compare
Signed-off-by: ff137 <ff137@proton.me>
d338cc0
to
cf5787e
Compare
Ready for review! I wanted to test compatibility with ACA-Py, but building and installing the python wrapper from my local branch, and running pytest in ACA-Py, gives me:
This resolves when I revert to installing official pypi package with I tried adding If anyone can assist or direct me on how to set this up for local testing with ACA-Py, will be much appreciated! |
A logical extension would be to add the custom ordering option to "fetch all" queries as well (in a future PR) |
Good news! Managed to successfully test the changes locally 🚀 Happy to confirm that all the ACA-Py tests pass using this branch's changes ✅ |
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
I think I'm gonna try add the ordering options for fetching all records -- not just for scanning. |
order_by
and descending
options to scan and fetch_all queries
Signed-off-by: ff137 <ff137@proton.me>
I've expanded ordering options to the I can confirm python wrapper works with changes (ACA-Py tests pass using this build). JavaScript wrapper still has some tests that remain to be fixed ... |
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
fe5c8a9
to
bd11dfe
Compare
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
@andrewwhitehead Please let me know if you've had moment to review, if there are any additional steps necessary here. Maybe changing default behavior, or implementing some specific tests. ACA-Py tests are passing with these changes here: openwallet-foundation/acapy#3173 And our end-to-end tests, asserting unique results across pages, are passing now (as described here: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think it looks good!
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
* ✨ add `order_by` and `descending` options to query / scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * ✨ add `order_by` and `descending` options to PaginatedQuerySchema Signed-off-by: ff137 <ff137@proton.me> * ✨ modify `get_limit_offset` to `get_paginated_query_params` Signed-off-by: ff137 <ff137@proton.me> * ✨ add ordering to InMemoryStorage scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * 🚧 test in-progress aries-askar PR: openwallet-foundation/askar#291 Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> * 🎨 fix ruff warning Signed-off-by: ff137 <ff137@proton.me> * ✅ fix assertions Signed-off-by: ff137 <ff137@proton.me> * 🚧 test aries-askar with TestPyPI package Signed-off-by: ff137 <ff137@proton.me> * 🚧 test latest askar testpypi package Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update order_by description and default value. Include in schema Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update aries-askar test pypi package to pre-orjson feat release Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me>
* ✨ add `order_by` and `descending` options to query / scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * ✨ add `order_by` and `descending` options to PaginatedQuerySchema Signed-off-by: ff137 <ff137@proton.me> * ✨ modify `get_limit_offset` to `get_paginated_query_params` Signed-off-by: ff137 <ff137@proton.me> * ✨ add ordering to InMemoryStorage scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * 🚧 test in-progress aries-askar PR: openwallet-foundation/askar#291 Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> * 🎨 fix ruff warning Signed-off-by: ff137 <ff137@proton.me> * ✅ fix assertions Signed-off-by: ff137 <ff137@proton.me> * 🚧 test aries-askar with TestPyPI package Signed-off-by: ff137 <ff137@proton.me> * 🚧 test latest askar testpypi package Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update order_by description and default value. Include in schema Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update aries-askar test pypi package to pre-orjson feat release Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
* ✨ add `order_by` and `descending` options to query / scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * ✨ add `order_by` and `descending` options to PaginatedQuerySchema Signed-off-by: ff137 <ff137@proton.me> * ✨ modify `get_limit_offset` to `get_paginated_query_params` Signed-off-by: ff137 <ff137@proton.me> * ✨ add ordering to InMemoryStorage scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * 🚧 test in-progress aries-askar PR: openwallet-foundation/askar#291 Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> * 🎨 fix ruff warning Signed-off-by: ff137 <ff137@proton.me> * ✅ fix assertions Signed-off-by: ff137 <ff137@proton.me> * 🚧 test aries-askar with TestPyPI package Signed-off-by: ff137 <ff137@proton.me> * 🚧 test latest askar testpypi package Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update order_by description and default value. Include in schema Signed-off-by: ff137 <ff137@proton.me> * 🐛 fix deserialisation of descending: bool parameter Signed-off-by: ff137 <ff137@proton.me> * ⏪ revert to testing 0.3.3b0 askar test package Signed-off-by: ff137 <ff137@proton.me> * 🔥 remove unnecessary record sorts (now that askar sorts by id == sorting by created_at) Signed-off-by: ff137 <ff137@proton.me> * ✅ fix test assertions -- wallet_list and connections_list no longer does additional sorting Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me>
* ✨ add `order_by` and `descending` options to query / scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * ✨ add `order_by` and `descending` options to PaginatedQuerySchema Signed-off-by: ff137 <ff137@proton.me> * ✨ modify `get_limit_offset` to `get_paginated_query_params` Signed-off-by: ff137 <ff137@proton.me> * ✨ add ordering to InMemoryStorage scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * 🚧 test in-progress aries-askar PR: openwallet-foundation/askar#291 Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> * 🎨 fix ruff warning Signed-off-by: ff137 <ff137@proton.me> * ✅ fix assertions Signed-off-by: ff137 <ff137@proton.me> * 🚧 test aries-askar with TestPyPI package Signed-off-by: ff137 <ff137@proton.me> * 🚧 test latest askar testpypi package Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update order_by description and default value. Include in schema Signed-off-by: ff137 <ff137@proton.me> * 🐛 fix deserialisation of descending: bool parameter Signed-off-by: ff137 <ff137@proton.me> * ⏪ revert to testing 0.3.3b0 askar test package Signed-off-by: ff137 <ff137@proton.me> * 🔥 remove unnecessary record sorts (now that askar sorts by id == sorting by created_at) Signed-off-by: ff137 <ff137@proton.me> * ✅ fix test assertions -- wallet_list and connections_list no longer does additional sorting Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me>
* ✨ add `order_by` and `descending` options to query / scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * ✨ add `order_by` and `descending` options to PaginatedQuerySchema Signed-off-by: ff137 <ff137@proton.me> * ✨ modify `get_limit_offset` to `get_paginated_query_params` Signed-off-by: ff137 <ff137@proton.me> * ✨ add ordering to InMemoryStorage scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * 🚧 test in-progress aries-askar PR: openwallet-foundation/askar#291 Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> * 🎨 fix ruff warning Signed-off-by: ff137 <ff137@proton.me> * ✅ fix assertions Signed-off-by: ff137 <ff137@proton.me> * 🚧 test aries-askar with TestPyPI package Signed-off-by: ff137 <ff137@proton.me> * 🚧 test latest askar testpypi package Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update order_by description and default value. Include in schema Signed-off-by: ff137 <ff137@proton.me> * 🐛 fix deserialisation of descending: bool parameter Signed-off-by: ff137 <ff137@proton.me> * ⏪ revert to testing 0.3.3b0 askar test package Signed-off-by: ff137 <ff137@proton.me> * 🔥 remove unnecessary record sorts (now that askar sorts by id == sorting by created_at) Signed-off-by: ff137 <ff137@proton.me> * ✅ fix test assertions -- wallet_list and connections_list no longer does additional sorting Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me>
* ✨ add `order_by` and `descending` options to query / scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * ✨ add `order_by` and `descending` options to PaginatedQuerySchema Signed-off-by: ff137 <ff137@proton.me> * ✨ modify `get_limit_offset` to `get_paginated_query_params` Signed-off-by: ff137 <ff137@proton.me> * ✨ add ordering to InMemoryStorage scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * 🚧 test in-progress aries-askar PR: openwallet-foundation/askar#291 Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> * 🎨 fix ruff warning Signed-off-by: ff137 <ff137@proton.me> * ✅ fix assertions Signed-off-by: ff137 <ff137@proton.me> * 🚧 test aries-askar with TestPyPI package Signed-off-by: ff137 <ff137@proton.me> * 🚧 test latest askar testpypi package Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update order_by description and default value. Include in schema Signed-off-by: ff137 <ff137@proton.me> * 🐛 fix deserialisation of descending: bool parameter Signed-off-by: ff137 <ff137@proton.me> * ⏪ revert to testing 0.3.3b0 askar test package Signed-off-by: ff137 <ff137@proton.me> * 🔥 remove unnecessary record sorts (now that askar sorts by id == sorting by created_at) Signed-off-by: ff137 <ff137@proton.me> * ✅ fix test assertions -- wallet_list and connections_list no longer does additional sorting Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me>
* ✨ add `order_by` and `descending` options to query / scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * ✨ add `order_by` and `descending` options to PaginatedQuerySchema Signed-off-by: ff137 <ff137@proton.me> * ✨ modify `get_limit_offset` to `get_paginated_query_params` Signed-off-by: ff137 <ff137@proton.me> * ✨ add ordering to InMemoryStorage scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * 🚧 test in-progress aries-askar PR: openwallet-foundation/askar#291 Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> * 🎨 fix ruff warning Signed-off-by: ff137 <ff137@proton.me> * ✅ fix assertions Signed-off-by: ff137 <ff137@proton.me> * 🚧 test aries-askar with TestPyPI package Signed-off-by: ff137 <ff137@proton.me> * 🚧 test latest askar testpypi package Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update order_by description and default value. Include in schema Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update aries-askar test pypi package to pre-orjson feat release Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me>
* ✨ add `order_by` and `descending` options to query / scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * ✨ add `order_by` and `descending` options to PaginatedQuerySchema Signed-off-by: ff137 <ff137@proton.me> * ✨ modify `get_limit_offset` to `get_paginated_query_params` Signed-off-by: ff137 <ff137@proton.me> * ✨ add ordering to InMemoryStorage scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * 🚧 test in-progress aries-askar PR: openwallet-foundation/askar#291 Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> * 🎨 fix ruff warning Signed-off-by: ff137 <ff137@proton.me> * ✅ fix assertions Signed-off-by: ff137 <ff137@proton.me> * 🚧 test aries-askar with TestPyPI package Signed-off-by: ff137 <ff137@proton.me> * 🚧 test latest askar testpypi package Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update order_by description and default value. Include in schema Signed-off-by: ff137 <ff137@proton.me> * 🐛 fix deserialisation of descending: bool parameter Signed-off-by: ff137 <ff137@proton.me> * ⏪ revert to testing 0.3.3b0 askar test package Signed-off-by: ff137 <ff137@proton.me> * 🔥 remove unnecessary record sorts (now that askar sorts by id == sorting by created_at) Signed-off-by: ff137 <ff137@proton.me> * ✅ fix test assertions -- wallet_list and connections_list no longer does additional sorting Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me>
* Rebase the pagination with ordering feature on latest release (#2) * ✨ add `order_by` and `descending` options to query / scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * ✨ add `order_by` and `descending` options to PaginatedQuerySchema Signed-off-by: ff137 <ff137@proton.me> * ✨ modify `get_limit_offset` to `get_paginated_query_params` Signed-off-by: ff137 <ff137@proton.me> * ✨ add ordering to InMemoryStorage scan and fetch_all methods Signed-off-by: ff137 <ff137@proton.me> * 🚧 test in-progress aries-askar PR: openwallet-foundation/askar#291 Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> * 🎨 fix ruff warning Signed-off-by: ff137 <ff137@proton.me> * ✅ fix assertions Signed-off-by: ff137 <ff137@proton.me> * 🚧 test aries-askar with TestPyPI package Signed-off-by: ff137 <ff137@proton.me> * 🚧 test latest askar testpypi package Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update order_by description and default value. Include in schema Signed-off-by: ff137 <ff137@proton.me> * 🐛 fix deserialisation of descending: bool parameter Signed-off-by: ff137 <ff137@proton.me> * ⏪ revert to testing 0.3.3b0 askar test package Signed-off-by: ff137 <ff137@proton.me> * 🔥 remove unnecessary record sorts (now that askar sorts by id == sorting by created_at) Signed-off-by: ff137 <ff137@proton.me> * ✅ fix test assertions -- wallet_list and connections_list no longer does additional sorting Signed-off-by: ff137 <ff137@proton.me> * ⬆️ Update lock file Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me> * arrow_up: Upgrade python-dateutil Resolves calling deprecated `datetime.utcfromtimestamp` method Signed-off-by: ff137 <ff137@proton.me> * art: Rename class to resolve PytestCollectionWarning Signed-off-by: ff137 <ff137@proton.me> * art: Replace deprecated `open_binary` method with `files` Signed-off-by: ff137 <ff137@proton.me> * art: Replace deprecated `scope` keyword with `loop_scope` Signed-off-by: ff137 <ff137@proton.me> * art: Filter Aries RFC 0160 DeprecationWarning in tests Signed-off-by: ff137 <ff137@proton.me> * art: Filter Pydantic UserWarning in test Signed-off-by: ff137 <ff137@proton.me> * arrow_up: Upgrade aiohttp to latest release and update lock file Signed-off-by: ff137 <ff137@proton.me> * art: Remove unnecessary asyncio pytest markers Resolves unclosed event loop warnings. Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me>
Closes #290
Adds ordering functionality to
scan
andfetch_all
queries, to allow for custom ordering of fetched storage records.