Skip to content

Every create timeseries example omits the required unit → HTTP 400 #5

Description

@samuelhel

Summary

The platform requires a non-blank unit on every timeseries at create time, but essentially every "create a series" example in the docs omits it. As written, the create step fails for Java, Python, and Rust — including the quickstart, the first thing a new user runs.

Repro

curl -s -i -X POST "$BASE_URL/timeseries/create" \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"items":[{"externalId":"engine_temperature","name":"Engine temperature","valueType":"FLOAT"}]}'
HTTP/1.1 400
{"items":[{"unit":"timeseries.unit.not.blank"}]}
Same failure via the SDK: api.time_series.create_one(&TimeSeries::new("engine_temperature", "Engine temperature")) → 400. Adding a unit (ts.unit = Some("celsius".into())) makes it succeed (201).

Why (not a regression to chase)

The constraint is intentional and long-standing: Timeseries.java carries @NotBlank(message = "timeseries.unit.not.blank") on unit, added in 2024. So the docs must supply a unit — this isn't a platform bug to wait on.

Scope (create sites missing a unit)

- Rust: 2 inline create_one(&TimeSeries::new(...)) — quickstart.mdx (engine_temperature) and discrete.mdx (station_07_scrap).
- Java: ~8 Timeseries.of(...) chains without .unit(...).
- Python: ~38 TimeSeries(external_id=...) without unit= (a few are multi-line false positives; most are real).

Notable cases:
- quickstart.mdx Rust is inconsistent with itself — the Java and Python tabs set unit("celsius"), the Rust tab does not.
- discrete.mdx station_07_scrap is unitless in all three languages.
- Many are legitimately dimensionless (*_fill_pct, *_occupancy_pct, *_moves, *_status, crane_02_hours, loop-created external_id=s) — the platform still requires a non-blank unit for them.

Proposed fix

Add a unit to every create example. Suggested conventions:
- Series whose id encodes a unit: use it (*_pct → "percent", *_kwh → "kWh", *_c → "celsius", *_bar → "bar", *_kpa → "kPa", *_bbl → "bbl", *_ms → "m/s", *_kw → "kW", *_minutes/*_hours → "min"/"h").
- Counts/events (_scrap, _moves, _sales, flagged_payments_feed): "count".
- Status/state (_status): "state".
- Match the language tabs to each other (fix the quickstart Rust to "celsius" first).

Found while running the SDK end-to-end against a live stack (create → ingest → query/aggregate all otherwise work).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions