Skip to content

Update API to d9a23f3: market_area refactor and structured errors#41

Merged
Marenz merged 1 commit intofrequenz-floss:v0.x.xfrom
Marenz:fix/api-update-market-area-refactor
Mar 9, 2026
Merged

Update API to d9a23f3: market_area refactor and structured errors#41
Marenz merged 1 commit intofrequenz-floss:v0.x.xfrom
Marenz:fix/api-update-market-area-refactor

Conversation

@Marenz
Copy link
Contributor

@Marenz Marenz commented Mar 9, 2026

Adapts the client to API commit d9a23f31446eeb62fe6599af23c49e563d49f0f3 which includes:

  • market_area moved from MarketLocation to MarketLocationRef (immutable ref field)
  • MarketLocationId.value wrapped in MarketLocationIdValue message
  • MarketLocationOperationResult now uses error: MarketLocationOperationError | None instead of flat success/error_code/error_message fields
  • UpsertResult now uses error: SampleUpsertError | None instead of flat success/error_code/error_message fields, and includes echoed direction/metric_type/metric_unit plus existing_sample on revision errors
  • MarketLocationsFilter.market_location_id_filters now takes MarketLocationIdValue instead of MarketLocationId

New types: MarketLocationOperationError, SampleUpsertError.

README and CLI examples updated to include market_area in MarketLocationRef and CLI arguments (format enterprise_id:market_area:location_id:type).

@github-actions github-actions bot added part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) labels Mar 9, 2026
@Marenz Marenz added the cmd:skip-release-notes It is not necessary to update release notes for this PR label Mar 9, 2026
@Marenz Marenz force-pushed the fix/api-update-market-area-refactor branch 2 times, most recently from 3cdad1c to 853bb91 Compare March 9, 2026 10:50
…ured errors

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
@Marenz Marenz force-pushed the fix/api-update-market-area-refactor branch from 853bb91 to 8dad69b Compare March 9, 2026 10:55
@github-actions github-actions bot added the part:docs Affects the documentation label Mar 9, 2026
@Marenz Marenz marked this pull request as ready for review March 9, 2026 10:58
"""Machine-readable classification of the failure."""

error_message: str
"""Human-readable diagnostic message for logging and debugging."""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep in mind: If you need to add more error types in the future, then it'd be worth it have like a MarketMetering BaseError which includes code and message and can be used to compose different error types.

@Marenz Marenz added this pull request to the merge queue Mar 9, 2026
Merged via the queue into frequenz-floss:v0.x.x with commit 94318f7 Mar 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd:skip-release-notes It is not necessary to update release notes for this PR part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants