Skip to content

[SPARK-58529][PYTHON][4.1] Relax RESULT_ROWS_MISMATCH assertion for cross-version old-client compatibility - #57776

Closed
Yicong-Huang wants to merge 1 commit into
apache:branch-4.1from
Yicong-Huang:backport-58529-branch-4.1
Closed

[SPARK-58529][PYTHON][4.1] Relax RESULT_ROWS_MISMATCH assertion for cross-version old-client compatibility#57776
Yicong-Huang wants to merge 1 commit into
apache:branch-4.1from
Yicong-Huang:backport-58529-branch-4.1

Conversation

@Yicong-Huang

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This backports the test-side change of SPARK-58529 to this maintenance branch. It relaxes the test_vectorized_udf_invalid_length assertion in test_pandas_udf_scalar.py to accept both this branch's SCHEMA_MISMATCH_FOR_PANDAS_UDF message (Result vector from pandas_udf was not the required length) and the RESULT_ROWS_MISMATCH message a newer server raises (The number of output rows ... must match the number of input rows).

No production code changes -- this branch continues to raise its existing message.

Why are the changes needed?

The pyspark-connect-old-client cross-version job clones a maintenance branch's tests and runs them against a newer (master) server. It currently pins branch-4.0, but the base is expected to advance to branch-4.1 / branch-4.2. When it does, an assertion pinned to the old pandas-specific substring would fail against a master server that no longer emits it (after SPARK-58529). Relaxing the assertion now -- to match both messages -- keeps this branch's own CI green today and prevents the cross-version job from breaking when its base advances.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

The relaxed regex was verified to match both this branch's message and the newer RESULT_ROWS_MISMATCH message. Existing test_vectorized_udf_invalid_length continues to run.

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

No.

Yicong-Huang added a commit that referenced this pull request Aug 5, 2026
…ross-version old-client compatibility

### What changes were proposed in this pull request?

This backports the test-side change of SPARK-58529 to this maintenance branch. It relaxes the `test_vectorized_udf_invalid_length` assertion in `test_pandas_udf_scalar.py` to accept both this branch's `SCHEMA_MISMATCH_FOR_PANDAS_UDF` message (`Result vector from pandas_udf was not the required length`) and the `RESULT_ROWS_MISMATCH` message a newer server raises (`The number of output rows ... must match the number of input rows`).

No production code changes -- this branch continues to raise its existing message.

### Why are the changes needed?

The `pyspark-connect-old-client` cross-version job clones a maintenance branch's tests and runs them against a newer (master) server. It currently pins `branch-4.0`, but the base is expected to advance to `branch-4.1` / `branch-4.2`. When it does, an assertion pinned to the old pandas-specific substring would fail against a master server that no longer emits it (after SPARK-58529). Relaxing the assertion now -- to match both messages -- keeps this branch's own CI green today and prevents the cross-version job from breaking when its base advances.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

The relaxed regex was verified to match both this branch's message and the newer `RESULT_ROWS_MISMATCH` message. Existing `test_vectorized_udf_invalid_length` continues to run.

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

No.

Closes #57776 from Yicong-Huang/backport-58529-branch-4.1.

Authored-by: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com>
Signed-off-by: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com>
@Yicong-Huang

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

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.

2 participants