Skip to content

0.1b3

Compare
Choose a tag to compare
@cretz cretz released this 14 Nov 21:01
· 167 commits to main since this release
7dedda3

⚠️ THIS IS A BETA RELEASE AND COMPATIBILITY MAY NOT BE MAINTAINED

Get from PyPI

Highlights

Workflow Sandbox

There is now an enabled-by-default workflow sandbox that attempts to ensure determinism via workflow isolation and
restricted access to known non-deterministic standard library calls. If you are importing third-party libraries inside
the same file as your workflow, this can incur a noticeable perf/mem penalty.

Also, if your workflow previously worked out of the sandbox, it may no longer work.

These issues can be mitigated. See https://github.com/temporalio/sdk-python#workflow-sandbox.

Listing Workflows and Multi-History Replayer

API improvements:

  • Client.list_workflows() - returns an async iterator of workflows based on
    visibility filter
  • WorkflowHandle.fetch_history_events() - returns an async iterator of history events
  • WorkflowHandle.fetch_history() - helper for the above that returns a full WorkflowHistory
  • WorkflowExecutionAsyncIterator.map_histories() - returns an async iterator of WorkflowHistory based on async
    iterator of workflows
  • ReplayWorkflow.replay_workflow() - replays single WorkflowHistory
  • ReplayWorkflow.replay_workflows() - replays async iterator of WorkflowHistory collecting results
  • ReplayWorkflow.workflow_replay_iterator() - async context manager providing an async iterator over replay results
    from an async iterator of WorkflowHistory

Using these APIs, users can now easily load many workflows and run their histories through a replayer. Among other
benefits, this can help users know how code changes might react on previous workflow executions.

Python 3.11 and Linux ARM Support

Python 3.11 is properly supported and early results show some speed improvement. Also, PyPI releases will now include
Linux ARM wheels.

Failure Converter

A custom temporalio.converter.FailureConverter can now be set as the DataConverter.failure_converter_class. In
addition to custom error conversion, this is also useful to set to
temporalio.converter.DefaultFailureConverterWithEncodedAttributes to force all error messages and stack traces to be
put in the encoded section of the failure, allowing them to run through a PayloadCodec for encryption.

Worker Fatal Errors

Worker fatal errors are rare, but previously they were not surfaced when using async with. Now, similar to
asyncio.timeout, the current task will be
cancelled on fatal error and that cancel will be caught at the end of the async context manager and the reason for fatal
will be raised. The alternative to async with, Worker.run(), now also raises fatal errors.

Note, fatal errors only occur after a while of internal retries.

💥 Breaking Changes

Not many and they are on less-often used parts.

⚠️ Multiple patched History Incompatibility

If you called patched for the same patch ID multiple times in the same workflow, this new release will be incompatible
with that workflow and you'll get non-determinism errors. patched is now memoized.

API Breaking Changes

  • Workflow sandbox may break registering/running workflows that it didn't used to
  • temporalio.worker.Replayer.replay_workflow now takes a temporalio.client.WorkflowHistory object instead of a proto
    object or JSON str/dict
  • temporalio.client.WorkflowExecutionDescription.raw renamed to raw_description
  • Failed queries now raise temporalio.client.WorkflowQueryFailedError instead of temporalio.client.RPCError
  • Configuring telemetry has changed from using the global temporalio.bridge.telemetry.init_telemetry package to making
    a new telemetryio.bridge.runtime.Runtime and passing that around.

Specific Changes

2022-10-03 - 0dd2312 - Move API reference site to Vercel (#148)
2022-10-19 - e436ecc - Multiple History Replay support (#158)
2022-10-28 - 0126e6e - Workflow sandbox (#164)
2022-10-28 - 5259f4c - Preload type hints and remove global lookup cache (#168)
2022-10-28 - 657a13d - Don't require timer presence when fired (#169)
2022-10-28 - bc62186 - Remove Go server from Python tests (#170)
2022-10-31 - e16bbc3 - ARM runner and Python 3.11 support (#172)
2022-11-01 - 656b77b - Add simple benchmark script (#180)
2022-11-01 - b4b3f82 - Support for list workflow, fetch workflow history, and iterable replay results (#175)
2022-11-03 - cfdc548 - Add StrEnum conversion support (#177)
2022-11-04 - 65c4025 - Prefix private modules with underscore (#183)
2022-11-07 - 2546871 - Minor updates (#186)
2022-11-07 - 6b9f554 - Propagate fatal worker errors (#188)
2022-11-07 - 87fd193 - Clarity on client thread safety and sync activity cancel (#189)
2022-11-07 - 929dc81 - Failure converter (#185)
2022-11-07 - a75256e - Feature/datetime conversion fix (#179)
2022-11-08 - 3901df8 - Memoize patched calls and support UUID conversion (#192)
2022-11-09 - 87b28a7 - Add missing UUID test case (#193)
2022-11-10 - eacdca8 - Sdk core related updates (#191)