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

Remove api_client instance which is initialised on load #472

Merged
merged 4 commits into from
Nov 29, 2023

Conversation

jacksonj04
Copy link
Collaborator

@jacksonj04 jacksonj04 commented Nov 28, 2023

Review and merge #468 first!

This instance which is initialised at load-time has been deprecated since v13.1.0, and all in-library references to it have been cleaned up in #468. No downstream code should be relying on this instance.

Previously, `SearchResultMetadata` had a static `create_from_uri` method
which was being called by `SearchResult`, which then ultimately
initialised an instance of `SearchResultMetadata`.

However, this is the _only_ place where this method was being called
from. This means we can push this method upwards into `SearchResult` and
avoid the need for a class acting as its own factory.
This method was making `SearchResponse` its own factory, but was only
ever being used to perform XML parsing. We can move this back up the
stack to clarify what is going on here.
Search, specifically metadata handling, was relying on the static
instance of api_client which was initialised as part of loading this API
library. This instance is due to be deprecated, which means that instead
the dynamic instance which is initialised by the calling code must be
passed back down the stack.
This has been deprecated since v13.1.0, and all in-library references to
it have been cleaned up. No downstream code should be relying on this
instance.
@jacksonj04 jacksonj04 changed the title Remove api_client instance Remove api_client instance which is initialised on load Nov 28, 2023
@jacksonj04 jacksonj04 merged commit 7da4c68 into main Nov 29, 2023
17 checks passed
@jacksonj04 jacksonj04 deleted the chore/remove-api_client-instance branch November 29, 2023 10:37
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