Skip to content

Support new API fields in ActivityHandle.describe - #1782

Open
maciejdudko wants to merge 4 commits into
temporalio:mainfrom
maciejdudko:saa-describe-payloads
Open

Support new API fields in ActivityHandle.describe#1782
maciejdudko wants to merge 4 commits into
temporalio:mainfrom
maciejdudko:saa-describe-payloads

Conversation

@maciejdudko

Copy link
Copy Markdown
Contributor

What was changed

  • Added options for retrieving optional payloads in ActivityHandle.describe()
  • Removed long polling from ActivityHandle.describe()
  • Added late-deserializing methods to ActivityExecutionDescription for payload-bearing properties
  • Refactored ActivityExecutionDescription creation, added missing properties and removed properties that don't exist or shouldn't be exposed
  • Adjusted @dataclass configuration for ActivityExecution and ActivityExecutionDescription

Why?

Implements newly added API features and removes parts that were not meant to be exposed.

Checklist

  1. How was this tested:

Updated tests.test_activity.TestDescribe

@maciejdudko
maciejdudko requested a review from a team as a code owner August 24, 2026 22:33
Comment thread temporalio/client/_activity.py Outdated


@dataclass(frozen=True)
@dataclass(eq=False, kw_only=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are you unfreezing the dataclasses?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mostly to allow swapping out data converter, but maybe that's wrong design. I can see the argument to keep these frozen, I'll re-add it.

Comment thread temporalio/client/_impl.py Outdated
info=resp.info,
long_poll_token=resp.long_poll_token or None,
# Erase unrequested fields if server sent them anyway (can happen with old server)
if not input.include_input:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems a little sketchy

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Currently (or until recently), the server sends heartbeat details and last failure unconditionally. This piece of code ensures the user has consistent view of data even if the server doesn't respect the default/false values in the request. One alternative is to keep the data in the proto but persist the include_ args in the description class and filter these out in the getters. Another is to just allow the possibility that these fields may be set anyway even if not requested. Of the three, I think erasing it from the proto is the best approach.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would probably lean towards just leaving it. Seems hard for there to be a real failure mode where the user needs to not get it. Clearing it is just pretending we're being more efficient.

@tconley1428 tconley1428 self-assigned this Aug 25, 2026
@maciejdudko
maciejdudko force-pushed the saa-describe-payloads branch from 10cfb2a to 794894e Compare September 1, 2026 18:03
@maciejdudko
maciejdudko force-pushed the saa-describe-payloads branch from 794894e to 7cfb7de Compare September 1, 2026 22:09


@dataclass(frozen=True)
@dataclass(frozen=True, eq=False, kw_only=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a good reason to add these where they weren't there before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ActivityExecutionDescription has dataConverter now so it can't have the automatic eq. Even for ActivityExecution, there's a possibility we add new fields in the future that will not work with eq. I also question the utility of having eq here. If a valid use case arises it can always be re-added later; removing it later won't be possible after stabilization.

Arguably, these should always have been kw_only as there are dozens of fields and the order is quite arbitrary.

GregoryTravis added a commit that referenced this pull request Sep 3, 2026
Drops the four include_* opt-ins, the eager payload members on
ActivityExecutionDescription, and the tests that exercise them, so that
#1782 owns the describe surface outright. Operator commands, the
ActivityOptionsKey/Update API and ActivityExecutionOptions are untouched.

Heartbeat-detail observation is impossible until #1782 lands: the server
withholds those payloads without the opt-in, so the three
*_preserves_heartbeat tests are removed here and should return afterwards
using 1782's await desc.heartbeat_details().
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.

2 participants