Copilot commented on code in PR #51163:
URL: https://github.com/apache/arrow/pull/51163#discussion_r3995178269


##########
python/pyarrow/_acero.pyx:
##########
@@ -594,6 +594,8 @@ cdef class Declaration(_Weakrefable):
             CDeclaration c_decl
 
         for decl in decls:
+            if not isinstance(decl, Declaration):
+                raise TypeError("Expected a Declaration")

Review Comment:
   This guard only protects `from_sequence`; `Declaration.__init__` still 
iterates `inputs` and performs the unchecked `(<Declaration>ipt).unwrap()` cast 
at line 569. An invalid value such as `Declaration(..., inputs=[0])` can 
therefore still dereference an invalid declaration before reaching native code. 
Please validate each `inputs` item there as well so the sibling entry point is 
protected.



-- 
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]

Reply via email to