Skip to content

Conversation

@huanliwang-db
Copy link
Contributor

What changes were proposed in this pull request?

agnosticEncoderFor[S] returns the wrong encoder when no initial state is provided in TWS. We should create an empty state encoder and use that instead.

Why are the changes needed?

Fix the incorrect behavior for TWS without initial state in spark connect

Does this PR introduce any user-facing change?

No

How was this patch tested?

N/A: unfortunately, this field is not used so far and it's not easy to provide the test coverage for this

Was this patch authored or co-authored using generative AI tooling?

No

val initialStateEncoder = if (initialState.isDefined) {
agnosticEncoderFor[S]
} else {
// Can not use `agnosticEncoderFor[S]` here because it points to incorrect encoder
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Cannot use

@anishshri-db
Copy link
Contributor

@huanliwang-db - linter failure seems relevant ?

Copy link
Contributor

@anishshri-db anishshri-db left a comment

Choose a reason for hiding this comment

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

+1 - pending comments and green CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants