Skip to content

Fix: Schedule force field dev version#218

Merged
Flix6x merged 4 commits into
mainfrom
fix/schedule-force-field-dev-version
Jul 23, 2026
Merged

Fix: Schedule force field dev version#218
Flix6x merged 4 commits into
mainfrom
fix/schedule-force-field-dev-version

Conversation

@BelhsanHmida

Copy link
Copy Markdown
Contributor

Summary

  • add a helper for API-generation-style server version checks
  • use it in trigger_schedule() when deciding the schedule force-new-job field name
  • preserve legacy force_new_job_creation behavior for older sensor endpoint usage
  • add regression coverage for both 0.33.0.dev* asset scheduling and older server fallback

Why

0.33.0.dev* compares lower than final 0.33.0 under normal packaging version semantics, but those dev servers can already expose the 0.33 asset scheduling API shape.

Without this, trigger_schedule(..., asset_id=..., prior=...) can send:

"force_new_job_creation": true

to the asset scheduling endpoint, which expects:

"force-new-job-creation": true

and rejects the request with a 422.

Tests

python -m pytest tests/client/test_schedule.py -q

closes #217

Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
@BelhsanHmida BelhsanHmida self-assigned this Jul 5, 2026
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 28741922547

Coverage increased (+0.04%) to 96.394%

Details

  • Coverage increased (+0.04%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (9 of 10 lines covered, 90.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/flexmeasures_client/client.py 10 9 90.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 721
Covered Lines: 695
Line Coverage: 96.39%
Coverage Strength: 2.89 hits per line

💛 - Coveralls

@Flix6x Flix6x left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks a lot for this fix, and apologies for the delay in reviewing! The base-version comparison is the right call, and the regression tests covering both the dev-0.33 asset endpoint and the older sensor endpoint fallback are much appreciated.

@Flix6x
Flix6x merged commit aa8107d into main Jul 23, 2026
12 checks passed
@Flix6x
Flix6x deleted the fix/schedule-force-field-dev-version branch July 23, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trigger_schedule fails with 422 on 0.33.0.dev server due to force_new_job_creation field

3 participants