Skip to content

Conversation

@purcell
Copy link
Contributor

@purcell purcell commented Dec 17, 2025

This PR makes the state machine explicit in ForwardingBuffer, and also bumps the minimum Python version to 3.10, since the match statement is used, and not available in 3.9.

The minimum backend runtime version of Python for localstack seems to now be 3.13, so for maximum compatibility we should probably align that across all extensions?

(I also bumped the version of this extension as part of this PR.)

@purcell purcell requested a review from whummer as a code owner December 17, 2025 17:22
Copy link
Member

@whummer whummer left a comment

Choose a reason for hiding this comment

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

Looks great @purcell - much cleaner with the explicit state management via ForwardingState! 👍

case ForwardingState.UNDECIDED:
self.buffer.append(data)

if headers := get_headers_from_data_stream(self.buffer):
Copy link
Member

Choose a reason for hiding this comment

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

small nitpick: I guess we could reverse the logic with if not ... and return, to reduce the level of indentation. (but really not critical, more a matter of taste / personal preference, so feel free to leave as-is :) )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think it could go either way. I personally find it clearer like this, but if the code grew longer, I'd switch it.

@purcell purcell merged commit e20717d into main Dec 18, 2025
1 check passed
@whummer whummer deleted the typedb-forwarding-state-machine branch December 18, 2025 09:50
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.

3 participants