Skip to content

Make all async functions for solr class#11772

Merged
cdrini merged 4 commits intomasterfrom
refactor/solr-async
Feb 6, 2026
Merged

Make all async functions for solr class#11772
cdrini merged 4 commits intomasterfrom
refactor/solr-async

Conversation

@RayBB
Copy link
Collaborator

@RayBB RayBB commented Jan 29, 2026

Make all async functions for solr class
This is a preparatory step so we can use these very soon.

Technical

Testing

Screenshot

Stakeholders

@RayBB RayBB force-pushed the refactor/solr-async branch from 8f842ac to 964c259 Compare January 29, 2026 20:34
@RayBB RayBB marked this pull request as ready for review February 3, 2026 17:41
@RayBB RayBB changed the title refactor/solr async Make all async functions for solr class Feb 3, 2026

def get_many(
@functools.wraps(get_async)
def get(self, *args, **kwargs):
Copy link
Collaborator

@cdrini cdrini Feb 6, 2026

Choose a reason for hiding this comment

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

Tested switching these to use async_bridge.wrap and they appear to be working!

Auto-complete docs now also include the fn description. And type parameters are persisted as I think they were before.

Image

Also confirmed the publishers page, which uses .select, populated correctly locally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cdrini that's an awesome improvement! Great find!

@cdrini cdrini self-assigned this Feb 6, 2026
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Lgtm! Tested on testing, publishers pages (which call select) work: https://testing.openlibrary.org/publishers/Standard_Ebooks

As does the my books page, which calls IIRC get_many: https://testing.openlibrary.org/people/ScarTissue/books/already-read?q=ebook_access%3Apublic

@cdrini cdrini merged commit 6d7053b into master Feb 6, 2026
8 checks passed
@cdrini cdrini deleted the refactor/solr-async branch February 6, 2026 21:10
@RayBB RayBB removed the On Testing label Feb 10, 2026
bhardwajparth51 added a commit to bhardwajparth51/openlibrary that referenced this pull request Feb 17, 2026
* make all async functions for solr class

* remove useless docstrings

* Switch to using async_bridge.wrap instead of functools.wraps

* Remove sync Solr.session ; no longer used!

---------

Co-authored-by: Drini Cami <cdrini@gmail.com>
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.

2 participants