felipecrv commented on code in PR #42098:
URL: https://github.com/apache/arrow/pull/42098#discussion_r1638303571
##########
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:
Yes, but I don't think it was the initial intention to have the table
contains the T->T pairs. Calling `Equals` before `CanCast` is the right
systematic solution.
<img width="1293" alt="Screenshot 2024-06-13 at 11 16 57"
src="https://github.com/apache/arrow/assets/207795/1387bfb5-8fb7-4b4b-bde1-50c38fbe3b79">
--
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]