Split converter.py into submodules#1365
Open
jmaeagle99 wants to merge 5 commits intotemporalio:mainfrom
Open
Conversation
5661521 to
c282f43
Compare
tconley1428
approved these changes
Mar 16, 2026
Contributor
tconley1428
left a comment
There was a problem hiding this comment.
Thanks for doing this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
temporalio/converter.py(~2,100 lines) into a proper Python package undertemporalio/converter/with the following submodules:_serialization_context.py—SerializationContext,WorkflowSerializationContext,ActivitySerializationContext,WithSerializationContext_payload_converter.py—PayloadConverter,EncodingPayloadConverter,CompositePayloadConverter,DefaultPayloadConverter, and all concrete encoding implementations (BinaryNull,BinaryPlain,JSONProto,BinaryProto,JSONPlain,JSONTypeConverter)_payload_limits.py—PayloadLimitsConfig,PayloadSizeWarning,_PayloadSizeError,_ServerPayloadErrorLimits_payload_codec.py—PayloadCodecand_apply_to_failure_payloads(moved out ofDataConverterto break a potential circular dependency)_failure_converter.py—FailureConverter,DefaultFailureConverter,DefaultFailureConverterWithEncodedAttributes_data_converter.py—DataConverteranddefault()_search_attributes.py— all search attribute encode/decode utilities__init__.pyre-exports all public names and handles module-level initialization (DataConverter.default,PayloadConverter.default,FailureConverter.default), preserving full backward compatibility — no call sites outside the package required changes__all__defined in__init__.pyto suppress F401 linter warnings and make the public API explicit; private names (_PayloadSizeError, etc.) are not re-exported but remain accessible via their submodulestemporalio/worker/andtemporalio/client.pyupdated to reference private types directly from their submodule (e.g.temporalio.converter._payload_limits._ServerPayloadErrorLimits) rather than through the package namespacegetLogger("temporalio.converter")to preserve the original log namespaceWhy?
Separate the concerns of each composite area and allow other changes (such as #1341) to not introduce circular dependencies.
Checklist