Repository navigation
Compose: send one ordered operations list - #239
Merged
Merged
Conversation
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.
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.
Closes #237
FastFuels-API-v2#711 replaced the compose request's
selectandcomputelists with one requiredoperationslist, each item tagged"type": "select"or"type": "compute". Output bands follow list order. The SDK still sent the old shape, so everycreate_grid_from_composecall failed with a 422 (missing body.operations).Changes
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, optionalUploadBandDefinition.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-onlyoperations=list in place ofselect=andcompute=, and sends it in the order given. The existing checks still run: the list must not be empty, outputs must be unique, items must beComposeSelectorComposeCompute, and alias/band references are validated.ff.compose.select()/ff.compose.compute(): set thetypetag, which the regenerated models require.composing-grids.mdguide and the design note useoperations=.type.operationsvalues are rejected.Breaking change
select=andcompute=are removed, with no alias. Old calls raiseTypeError: unexpected keyword argument. The release needs a version bump and a changelog line.Known gap
Grid.resampledoesn't match the regenerated request: a bareresample()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 passedpytest tests/v2/test_compose.py -k liveagainst prod: 1 passedpytest tests/v2 -k "not live": 492 passed, 1 skipped