Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update server-side State.data to accept arbitrary JSON #6896

Merged
merged 9 commits into from
Sep 21, 2022

Conversation

zanieb
Copy link
Contributor

@zanieb zanieb commented Sep 20, 2022

Requires #6895

Updates server-side schemas to accept any JSON for State.data instead of enforcing a DataDocument blob. This means that the client is responsible for deciding the format for results.

Example

The client-side state schema still enforces a DataDocument, so you cannot use the OrionClient to take advantage of this change. A manual API request could be made though.

client.post(
    f"/flow_runs/{flow_run.id}/set_state",
    json={"state": {"type": "COMPLETED", data="test"}},
)

Checklist

  • [ ] This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a fix, feature, enhancement, docs, collections, or maintenance label categorizing the change.

@zanieb zanieb force-pushed the results/8-data-agnostic-server branch from 7624e74 to 9d1c90e Compare September 20, 2022 17:00
@zanieb zanieb added the enhancement An improvement of an existing feature label Sep 20, 2022
@zanieb zanieb marked this pull request as ready for review September 20, 2022 17:08
Copy link
Contributor

@bunchesofdonald bunchesofdonald left a comment

Choose a reason for hiding this comment

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

Yes please :)

Base automatically changed from state-schemas to feature/results September 21, 2022 15:56
@zanieb zanieb requested a review from cicdw as a code owner September 21, 2022 15:56
@zanieb zanieb merged commit dda6b26 into feature/results Sep 21, 2022
@zanieb zanieb deleted the results/8-data-agnostic-server branch September 21, 2022 18:25
zanieb added a commit that referenced this pull request Sep 28, 2022
* Move result method to client-specific state schema

* Fix import of `rules`

* Move `OrchestrationResult` to `schemas.responses` to fix circular imports

* Repair some imports in the test suite

* Update flow and task tests to use client-side schemas

* Fix tests; update `cls` addition to be backwards compatible

* Update server-side `State.data` to accept arbitrary JSON

* Add test
@zanieb zanieb mentioned this pull request Oct 5, 2022
3 tasks
zanieb added a commit that referenced this pull request Oct 6, 2022
* Move result method to client-specific state schema

* Fix import of `rules`

* Move `OrchestrationResult` to `schemas.responses` to fix circular imports

* Repair some imports in the test suite

* Update flow and task tests to use client-side schemas

* Fix tests; update `cls` addition to be backwards compatible

* Update server-side `State.data` to accept arbitrary JSON

* Add test
zanieb added a commit that referenced this pull request Oct 12, 2022
* Move result method to client-specific state schema

* Fix import of `rules`

* Move `OrchestrationResult` to `schemas.responses` to fix circular imports

* Repair some imports in the test suite

* Update flow and task tests to use client-side schemas

* Fix tests; update `cls` addition to be backwards compatible

* Update server-side `State.data` to accept arbitrary JSON

* Add test
zanieb added a commit that referenced this pull request Oct 12, 2022
* Move result method to client-specific state schema

* Fix import of `rules`

* Move `OrchestrationResult` to `schemas.responses` to fix circular imports

* Repair some imports in the test suite

* Update flow and task tests to use client-side schemas

* Fix tests; update `cls` addition to be backwards compatible

* Update server-side `State.data` to accept arbitrary JSON

* Add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants