Ernesto Ocampo created ARROW-2392:

             Summary: pyarrow RecordBatchStreamWriter allows writing batches 
with different schemas
                 Key: ARROW-2392
             Project: Apache Arrow
          Issue Type: Bug
            Reporter: Ernesto Ocampo

A RecordBatchStreamWriter initialised with a given schema will still allow 
writing RecordBatches that have different schemas. Example:

schema = pa.schema([pa.field('some_field', pa.int64())])
stream = pa.BufferOutputStream()
writer = pa.RecordBatchStreamWriter(stream, schema)

data = [pa.array([1.234])]
batch = pa.RecordBatch.from_arrays(data, ['some_field'])  
# batch does not conform to schema

assert batch.schema != schema

writer.write_batch(batch)  # no exception raised

This message was sent by Atlassian JIRA

Reply via email to