Repository navigation
Say that an empty value of another type still means no value - #39
Merged
Merged
Conversation
The README and the constructor docstring said any non-string base_url, application, version, key or install_id raises a ValueError naming the argument. An empty one (0, False, []) does not: it keeps its old meaning, as test_an_empty_value_of_another_type_keeps_its_old_meaning pins down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (performed inline in the same session; not an independent review):
Judgment note: README.md:33 — "as it was before that check" relies on the reader knowing that the type check was added in 0.4.x. It was kept short on purpose. The concrete outcomes (no key, no ID, " is required") carry the meaning without it. Do-not-auto-merge paths: none matched. This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
2 of 3 tasks
dmccoystephenson
added a commit
that referenced
this pull request
Nov 13, 2026
…rgument checks (#40) The README said the constructor checks the opt-out variables "before anything else", but it checks its arguments first: a bad one raises ValueError even with DO_NOT_TRACK=1. Say so, and lock it in with a test. Also put the version section's first paragraph back in order: the sentence saying every event carries the version as a tag had drifted behind the argument checks added in #35 and #39, leaving its "it" pointing at the wrong thing. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
trace_client/trace_client.py,pyproject.toml,trace_client/__init__.pyand.github/workflows/build.yml.README.md("Every event carries the program's version") and theTraceClient.__init__docstring both said that any non-stringbase_url,application,version,keyorinstall_idraises aValueErrornaming the argument. The type check isif given and not isinstance(given, str), so an empty value of another type (0,False,[]) is let through and keeps its old meaning: no key (disabled_reason == "no key"), no installation ID, or"<argument> is required"for the positional arguments. That behavior is deliberate and pinned bytest_an_empty_value_of_another_type_keeps_its_old_meaning, so the docs were corrected and the code was left alone.trace), the opt-out values and precedence, thedisabled_reasonstrings, the wire format (endpoint, headers, omission rules,201, no redirects, User-Agent), the Building section vs. the CI matrix, and the version string in all five places (0.4.2).No tracking issue: the gap was found during the triage sweep.
Skipped issue: #16 was not picked. It is still blocked on an owner decision about the
MAX_TAGScap and on a coordinated change in trace-client-java.trace-client-java: no change needed. This PR only touches docs, and no Java-visible behavior changed.
Test plan
python3 -m compileall -q trace_client testspython3 -m unittest(Python 3.8.10 locally): ran 76 tests, OKtest (3.8),test (3.10),test (3.12)greenThis PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson