Skip to content

Commit a50f74d

Browse files
committed
Update InconsistentSchema error message
1 parent 417f836 commit a50f74d

File tree

1 file changed

+5
-5
lines changed
  • matlab/src/matlab/+arrow/+tabular

1 file changed

+5
-5
lines changed

matlab/src/matlab/+arrow/+tabular/Table.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ function displayScalarObject(obj)
158158
otherSchemas = cellfun(@(rb) rb.Schema, batches(2:end), UniformOutput=false);
159159
idx = cellfun(@(other) ~isequal(firstSchema, other), otherSchemas, UniformOutput=true);
160160
inconsistentSchemaIndex = find(idx, 1,"first");
161-
if ~isempty(badIndex)
162-
badIndex = badIndex + 1;
161+
if ~isempty(inconsistentSchemaIndex)
162+
inconsistentSchemaIndex = inconsistentSchemaIndex + 1;
163163
expectedSchema = arrow.tabular.internal.display.getSchemaString(firstSchema);
164-
inconsistentSchema = arrow.tabular.internal.display.getSchemaString(batches{inconsistentSchemaIndex }.Schema);
165-
msg = "Schema of RecordBatch %d is\n\n\t%s\n\nExpected RecordBatch Schema to be\n\n\t%s";
166-
msg = compose(msg, badIndex, unexpectedSchema, expectedSchema);
164+
inconsistentSchema = arrow.tabular.internal.display.getSchemaString(batches{inconsistentSchemaIndex}.Schema);
165+
msg = "All RecordBatches must have a the same Schema.\n\nSchema of RecordBatch %d is\n\n\t%s\n\nExpected RecordBatch Schema to be\n\n\t%s";
166+
msg = compose(msg, inconsistentSchemaIndex, inconsistentSchema, expectedSchema);
167167
error("arrow:Table:FromRecordBatches:InconsistentSchema", msg);
168168
end
169169
end

0 commit comments

Comments
 (0)