You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "gaogaotiantian (via GitHub)" <gi...@apache.org> on 2026/05/04 22:46:26 UTC

Re: [PR] [SPARK-56612][PYTHON] Unify verify_result and container-type checks into verify_return_type helper [spark]

gaogaotiantian commented on code in PR #55532:
URL: https://github.com/apache/spark/pull/55532#discussion_r3184963244


##########
python/pyspark/worker.py:
##########
@@ -234,46 +251,56 @@ def chain(f, g):
     return lambda *a: g(f(*a))
 
 
-def verify_result(expected_type: type) -> Callable[[Any], Iterator]:
-    """
-    Create a result verifier that checks both iterability and element types.
+@overload

Review Comment:
   Let's do explicit type ignore at callsite. The `Any -> Any` case basically breaks other checks. All the iterator cases fall into the `Any` case and we lose track of the actual data type. Let's throw away any `Any`, use `type: ignore[type-abstract]` to ignore that warning. We will still have a lot of information (the return type from the function for example).



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org