HyukjinKwon commented on PR #58777:
URL: https://github.com/apache/spark/pull/58777#issuecomment-5672860290

   <!-- ai-code-review -->
   **Review — [MINOR][TESTS][CONNECT] Assert DataFrame column resolution 
errors**
   
   Verdict: LGTM once the lint/format failure is fixed.
   
   The change is clean and well-targeted: it tightens the shared 
column-resolution tests from "any `AnalysisException`" to the exact public 
error condition, with the `assert_column_resolution_error` helper cleanly 
selecting the API-specific expectation — the base `ColumnTestsMixin` asserts 
`classic_condition`, and the `ColumnParityTests` override asserts 
`connect_condition` (inherited by the lenient parity suite). The lenient-mode 
overrides in `ColumnParityTestsWithNonStrictDFColResolution` cover exactly the 
three shadowing tests that resolve via name-based fallback, and the remaining 
error tests are documented as raising in all modes — so the inherited 
`connect_condition` assertion is valid under both strict and lenient modes. The 
new `test_resolve_generator_after_projection` is a valid regression test: a 
generator does not re-introduce a projected-away tagged column, so `df.arr` 
lands in `missingInput` → 
`MISSING_ATTRIBUTES.RESOLVED_ATTRIBUTE_MISSING_FROM_INPUT` (Classic) / `
 CANNOT_RESOLVE_DATAFRAME_COLUMN` (Connect).
   
   One blocking nit — this is the still-open "Please fix lint issues": `ruff 
format --check` reformats both files. The `assert_column_resolution_error` 
signature is hand-wrapped across three lines but fits on one (97 chars, ≤ 100):
   
   ```python
       def assert_column_resolution_error(self, exception, *, 
classic_condition, connect_condition):
   ```
   
   `dev/lint-python` runs `ruff format --check`, so CI stays red until this is 
applied to both `test_column.py` and `test_parity_column.py`. 
`dev/reformat-python` (or `ruff format`) fixes it.
   
   No correctness or compatibility concerns otherwise for this test-only change.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to