Repository navigation
fix: allow copied clients to clear default headers and query - #92
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.
Passing an empty mapping to
copy(set_default_headers={})orcopy(set_default_query={})currently retains the original defaults. The truthiness fallback treats{}like an omitted replacement. This also affectswith_options()and both sync and async clients.Use an explicit
is not Nonecheck so an empty replacement clears the selected defaults. Ordinarydefault_headers/default_queryoverrides still merge, andNonestill preserves the inherited values. The change lives in the hand-maintainedcustom/supermemory/_compat.py; the checked-insrcmirror is copied from that source using the same operation asscripts/apply_custom.py.Added 24 HTTPX MockTransport regression cases exercising actual
namespaces.list()requests through both clients and both copy methods. They cover empty/nonempty replacements, omitted replacements, merging, authentication preservation, and the unchanged original client. Twelve cases fail against the original code.Validation:
pytest --ignore=tests/live -q). No live API calls were made.custom tests scripts examplespass;git diff --checkpasses.core/unchecked_base_model.py:158TypeForm incompatibility; the same error was reproduced after restoring the original compatibility modules.SKIP_FETCH=1 scripts/generate, but stops because a running Docker daemon is required. The custom source and derived mirror are byte-identical; fresh Fern generation has not been verified locally.