Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions python/pyspark/sql/streaming/stateful_processor_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,14 +516,11 @@ def normalize_value(v: Any) -> Any:
else:
return v

converted = [normalize_value(v) for v in data]
converted = tuple(normalize_value(v) for v in data)
else:
converted = list(data)
converted = data

field_names = [f.name for f in schema.fields]
row_value = Row(**dict(zip(field_names, converted)))
Copy link
Copy Markdown
Contributor Author

@jiateoh jiateoh Mar 26, 2026

Choose a reason for hiding this comment

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

PR Description contains explanation/breakdown of why this is safe: TLDR is that the inputs to Schema.toInternal before/after this change are a tuple/list that is positionally ordered based on the input data.


return self.pickleSer.dumps(schema.toInternal(row_value))
return self.pickleSer.dumps(schema.toInternal(converted))

def _deserialize_from_bytes(self, value: bytes) -> Any:
return self.pickleSer.loads(value)
Expand Down