Repository navigation
fix: honor environment overrides when copying clients - #796
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
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.
Problem
client.with_options(environment="sandbox")andclient.copy(environment="sandbox")keep using the original production URL. The copy constructor unconditionally receivesself.base_url, whose explicit value takes precedence over the requested environment. Switching from sandbox to production has the same problem. Both sync and async clients are affected.Change
When an environment is explicitly selected and no custom base URL is supplied, let the constructor resolve that environment's URL. Continue inheriting the original URL for ordinary copies, and preserve an explicitly supplied custom base URL's precedence.
Add12 regressions. Eight captured public
cards.list()request cases exercise production↔sandbox switches through bothcopyandwith_options, sync and async. Four controls verify custom URL overrides and ordinary-copy inheritance. All requests use an HTTPX MockTransport with dummy credentials; no Lithic service is contacted. The original client also retains its original URL.Before the fix:8 fail,4 pass. After:all12 pass.
Validation
CONTRIBUTING.md permits persisted manual changes in generated modules; maintainers may also wish to propagate this to the generator.