Skip to content

[doc] Document the Python memory value contract and its divergence from Java#840

Merged
wenjin272 merged 1 commit into
apache:mainfrom
weiqingy:723-pr2b-docs
Jun 12, 2026
Merged

[doc] Document the Python memory value contract and its divergence from Java#840
wenjin272 merged 1 commit into
apache:mainfrom
weiqingy:723-pr2b-docs

Conversation

@weiqingy

Copy link
Copy Markdown
Collaborator

Linked issue: #723

Purpose of change

Document the Python memory value contract and why it diverges from Java. The docs previously told Python users they could store Java POJOs and Kryo "general class types" and showed an example storing a Pydantic model — but Python memory values cross the Pemja boundary into Flink state, so only recursively checkpoint-stable values survive checkpoint/restore.

This splits the "Supported Value Types" section into a Java contract (broad: primitives, collections, POJOs, Kryo, MemoryObject) and a Python contract (None, bool, int, float, str, list, dict with str keys, and nested MemoryObject), names the rejected Python types, notes that bytes is not yet supported, and shows the materialize-on-write / reconstruct-on-read pattern (model.model_dump(mode="json")Model.model_validate(...)). The Java tab and examples are unchanged.

This follows up #839, which added the set()-time validator that enforces this Python contract. It should merge after #839.

Tests

Documentation only; no code change.

API

No API change.

Documentation

  • doc-needed
  • doc-not-needed
  • doc-included

…om Java

Python memory values cross the Pemja boundary into Flink state, so only
recursively checkpoint-stable values survive checkpoint/restore. The docs
previously advertised Java POJO/Kryo support for Python and showed an
example storing a Pydantic model.

Split "Supported Value Types" into a Java contract (primitives,
collections, POJOs, Kryo, MemoryObject) and a Python contract
(None/bool/int/float/str, list, dict[str, ...], nested MemoryObject),
name the rejected Python types, note bytes is not yet supported, and
show the materialize-on-write / reconstruct-on-read pattern. The Java
tab is unchanged.

Follows apache#839, which added the set()-time validator that enforces this
Python contract. This closes part of apache#723.
@github-actions github-actions Bot added doc-included Your PR already contains the necessary documentation updates. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue. labels Jun 11, 2026

@wenjin272 wenjin272 left a comment

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.

LGTM

@wenjin272 wenjin272 merged commit de4f036 into apache:main Jun 12, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-included Your PR already contains the necessary documentation updates. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants