Skip to content

Compose: send one ordered operations list - #239

Merged
amarcozzi merged 3 commits into
mainfrom
237-compose-operations
Oct 16, 2026
Merged

amarcozzi merged 3 commits into
mainfrom
237-compose-operations

Conversation

@amarcozzi

Copy link
Copy Markdown
Contributor

Closes #237

FastFuels-API-v2#711 replaced the compose request's select and compute lists with one required operations list, each item tagged "type": "select" or "type": "compute". Output bands follow list order. The SDK still sent the old shape, so every create_grid_from_compose call failed with a 422 (missing body.operations).

Changes

  • Client regen (fastfuels_sdk/v2/client_library/, its own commit): regenerated from the current prod spec. Besides compose, this pulls in already-deployed changes. It covers the regen step of Regenerate the v2 client for band quantities (API-v2 #682) #236 (band quantities, optional UploadBandDefinition.type_), the split key requests, the LANDFIRE disturbance request, and the stricter resample alignment that Resample: always send an alignment with a resolution (API-v2 #710) #238 tracks. None of the hand-written follow-ups for Regenerate the v2 client for band quantities (API-v2 #682) #236 or Resample: always send an alignment with a resolution (API-v2 #710) #238 are in this PR.
  • create_grid_from_compose: takes a required, keyword-only operations= list in place of select= and compute=, and sends it in the order given. The existing checks still run: the list must not be empty, outputs must be unique, items must be ComposeSelect or ComposeCompute, and alias/band references are validated.
  • ff.compose.select() / ff.compose.compute(): set the type tag, which the regenerated models require.
  • Docs: the docstring, the composing-grids.md guide and the design note use operations=.
  • Tests:
    • The builders emit type.
    • The request body keeps list order.
    • Invalid operations values are rejected.
    • The live test sends compute before select and checks the bands come back in that order.

Breaking change

select= and compute= are removed, with no alias. Old calls raise TypeError: unexpected keyword argument. The release needs a version bump and a changelog line.

Known gap

Grid.resample doesn't match the regenerated request: a bare resample() now fails in the client instead of with a 422 from the API. That is tracked in #238.

Verification

  • pytest tests/v2/test_compose.py -k "not live": 26 passed
  • pytest tests/v2/test_compose.py -k live against prod: 1 passed
  • pytest tests/v2 -k "not live": 492 passed, 1 skipped

Picks up the compose request change from separate select/compute lists
to a single ordered operations list, plus other already-deployed spec
changes.
The compose endpoint now takes a single required operations list, each
item tagged select or compute, instead of separate select and compute
lists. create_grid_from_compose takes operations= in place of select=
and compute=, passes the list through in order, and the select() and
compute() builders set the type tag. Tests and the composing-grids
guide use the new shape.
The API now names the Fosberg output band fuel_moisture.1hr (API-v2 #682).
Update the docstring, the creating-grids guide and the live test, which
failed against prod.
@amarcozzi
amarcozzi merged commit aa982ec into main Oct 16, 2026
4 checks passed
@amarcozzi
amarcozzi deleted the 237-compose-operations branch October 16, 2026 20:45
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.

Compose: send one operations list (API-v2 #711)

1 participant