felipecrv commented on code in PR #42098:
URL: https://github.com/apache/arrow/pull/42098#discussion_r1636869000


##########
python/pyarrow/src/arrow/python/ipc.cc:
##########
@@ -79,7 +79,8 @@ Status 
CastingRecordBatchReader::Init(std::shared_ptr<RecordBatchReader> parent,
 
   // Ensure all columns can be cast before succeeding
   for (int i = 0; i < num_fields; i++) {
-    if (!compute::CanCast(*src->field(i)->type(), *schema->field(i)->type())) {
+    if ((!((src->field(i)->type()->Equals(schema->field(i)->type())))) &&
+        (!compute::CanCast(*src->field(i)->type(), 
*schema->field(i)->type()))) {

Review Comment:
   I only checked your full comment now. Sorry for asking a question already 
answered.
   
   I think this is the right fix and we shouldn't have the T->T cast functions 
in the table. With that said, `CanCast` should probably be deprecated at some 
point and replaced with something less error prone.



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