Add cached property for service points (#142) - #143
Merged
btravisebsco merged 3 commits intoJul 29, 2026
Conversation
|
btravisebsco
deleted the
feature/add-cached-property-for-service-points-142
branch
July 29, 2026 22:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Closes #142
Adds a
service_pointscached property toFolioClient, mirroring the existinglocationscached property pattern. This avoids redundant HTTP calls when service point data is accessed in multiple contexts (e.g. validating defaults, mapping values, and resolving service point names during circulation workflows).Changes
src/folioclient/FolioClient.py: Added@cached_propertyservice_pointsfetching from/service-pointswith theservicepointsrecord key, using the samefolio_get_all+cql_allpattern aslocations.tests/test_folio_client.py: Addedtest_service_points_cached_property— verifies the correct endpoint/key are used and that the result is cached after the first call (i.e.folio_get_allis called only once across multiple accesses).tests/integration_tests.py: Addedtest_service_points_cached_propertytoTestCachedProperties— verifies consistency and identity of the cached value against live environments, with graceful skips forFolioPermissionErrorandFolioResourceNotFoundError.Test results
1 passed1 passedacross all reachable environments; one environment (snapshot-2-eureka) was unreachable at time of testing (DNS/connectivity error, pre-existing infra issue).