May 7, 2024
Python SDK v.1.6.0
Get from PyPI
The internal eviction logic has been overhauled to make sure that asyncio tasks are completed before a workflow is removed from the cache and garbage collected. For all properly running workflows this should not cause any issues. However, workflows that may have been developed in invalid ways in the past could have a problem being evicted from cache and will log as such. Users should keep an eye out for logs when upgrading to this version.
When a workflow raises an exception that wasn't ApplicationError
or bubbled from a Temporal call (e.g. activity failure), it would be a "task failure" which puts the workflow in a suspended state retrying the task until a code fix is deployed. An experimental feature is now available that lets users set which exception types should instead fail the workflow instead of suspending it. Users can now set the per-workflow failure_exception_types
on the @workflow.defn
decorator or set the worker-level workflow_failure_exception_types
when creating the Worker
. If an exception extends from one of these when raised, it will fail the workflow when raised.
Python clients now officially support HTTP CONNECT proxies. The http_connect_proxy_config
argument can now be set when connecting a Client
.
Workers can now have the client they use replaced without shutting down the worker. The client
property on the Worker
can be set to a different connected client. This is useful for users that need to change options like mTLS client certificate without worker downtime. The worker will not interrupt any polling calls but will start using the new client for subsequent calls.
If you use API keys in your Temporal server (i.e. Bearer
tokens on Authorization
headers), you can now set api_key
when connecting a Client
or set the api_key
property on an existing client to update it.
Users using metric_meter()
directly to create metrics (off of runtime, activity, or workflow) can now create float-based histograms and gauges, and duration-based histograms. Similarly users using MetricBuffer
to retrieve metrics can say how they want to retrieve durations (float seconds, int milliseconds, or timedelta
). A durations_as_seconds
option was added to telemetry options for users that prefer seconds as float-based durations to OpenTelemetry and Prometheus instead of the default of integer milliseconds.
A new count_workflows
call has been added to the Client
that takes the same query as list_workflows
but is optimized just to perform counts.
extra
on LogRecord
ChangedActivity logs and workflow logs used to set activity_info
and workflow_info
on LogRecord
respectively as the full info dataclasses by default. This was not usable by many third-party logging tools that can only work with dict
s and not dataclass
es. Therefore the default was changed to set temporal_activity
and temporal_workflow
on the respective log records to dict
s of commonly needed information. temporalio.activity.logger.full_activity_info_on_extra
and/or temporalio.workflow.logger.full_workflow_info_on_extra
can be set to True
to put those info entries back on extra
.
This only affects those using advanced log handlers that leverage contextual state. The log messages themselves are unaffected.
2024-03-04 - 477aa31 - Fix execute_child_workflow apidoc (#483) 2024-03-13 - f3d1b85 - API key client option (#486) 2024-03-26 - 36fe961 - Remove experimental flag from start_delay (#492) 2024-04-01 - 13d18ca - Update core and add durations-as-seconds metric option (#498) 2024-04-02 - b07e75e - Change default "extra" contents of activity/workflow logs (#490) 2024-04-05 - 1001653 - HTTP CONNECT proxy support (#501) 2024-04-05 - 466da16 - Safe Eviction (#499) 2024-04-12 - b45447e - Add macOS ARM runner (#506) 2024-04-12 - cf4c7cb - Ensure extra data on task fail logs (#502) 2024-04-18 - 50c2033 - Support float and duration metrics (#508) 2024-04-19 - ecd703d - Add Client.count_workflows (#510) 2024-04-30 - 0bb94f8 - Ability for certain task failure types to fail workflow (#516) 2024-05-03 - 0687151 - Worker client replacement (#517)