python(fix): support nested calculated channel references#580
Merged
Conversation
Contributor
|
Python docs preview: https://sift-stack.github.io/sift/python/pr-580/ Deployed from |
alexluck-sift
approved these changes
May 22, 2026
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.
Summary
calculated_channel: CalculatedChannel | strfield onChannelReferenceand routes it into the proto'scalculated_channel_version_idoneof when serializing calculated channels (create + update), rules (create + update), and exports. ACalculatedChannelinput is normalized to itsversion_idvia a validator; a string is interpreted as a version_id directly.resolve_calculated_channelswhen a version reference is already provided, so nested references don't get treated as native channel lookups and fail.Rule._from_protoandChannelReference._from_prototo read the version ID back off the proto oneof on the response path.Use case:
Validation
ChannelReferencevalidation and proto round-tripping (oneof read + write), including object input, string input, and rejection casesRule._from_protoround tripresolve_calculated_channelsskipping the name lookup when a version reference is providedcalculated_channelfield onChannelReferenceand confirmed there were no missing dependents.