test(python): follow the api's unit catalogue check on timeseries create - #169
Merged
Merged
Conversation
A sent unitExternalId now has to name a catalogue unit, and is looked up before the body is validated (platform 9a8b931a, e93271c8). So a valid id stands in for unit, which is filled from the catalogue; a blank, short or unknown one is a bad-request naming only unitExternalId, even when other fields are wrong too; and a unit that disagrees with the id is kept. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
olavgg
approved these changes
Sep 30, 2026
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
Follow-up to #166. I wrote that PR from probes against an api that predated platform
e93271c8and9a8b931a. On current platformmain, aunitExternalId, when sent, must name a unit in the catalogue, and it is looked up before the rest of the body is validated.test_timeseries_rejections.pynow pins that:unit.unit_external_id="pressure_bar"alone is created, withunitfilled from the catalogue ("bar"). test(python): pin what timeseries.create refuses #166 pinned the opposite.""," ","ab"and"no_such_unit_xyz"are each a 400 of typebad-requestnaming onlyunitExternalId. Before, the first and third wereconstraint-violations from the size check, and the second and fourth were accepted.unitExternalIdis reported alone even when other fields are wrong too, because the lookup throws before validation. The several-bad-fields test now usesexternal_idfor its third bad field.unitthat disagrees with the id (Celsiusonpressure_bar) is stored as sent, as the platform commit says.code, whichbad-requestomits.With this, #166's "things the api accepts" list reduces to the disagreeing
unit, which is intended.No SDK surface changes, so no docs pages are affected.
Test plan
test_timeseries_rejections.pyagainst an api built from platformmain(c379d686): 29 passedATTEMPT_TO_READ_AFTER_EOFfault on/events/filter, and the listen test under parallel load. Neither is related.🤖 Generated with Claude Code