Skip to content

Commit

Permalink
ogr_parquet.py: test behaviour on empty file (refs #8509)
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 3, 2023
1 parent 48f46f8 commit 3d0ba02
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions autotest/ogr/ogr_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,26 @@ def test_ogr_parquet_arrow_stream_numpy():
)


###############################################################################
# Test reading an empty file with GetArrowStream()


def test_ogr_parquet_arrow_stream_empty_file():

ds = ogr.GetDriverByName("Parquet").CreateDataSource("/vsimem/test.parquet")
ds.CreateLayer("test", geom_type=ogr.wkbPoint)
ds = None
ds = ogr.Open("/vsimem/test.parquet")
lyr = ds.GetLayer(0)
assert lyr.TestCapability(ogr.OLCFastGetArrowStream) == 1
stream = lyr.GetArrowStream()
assert stream.GetNextRecordBatch() is None
del stream
ds = None

ogr.GetDriverByName("Parquet").DeleteDataSource("/vsimem/test.parquet")


###############################################################################


Expand Down

0 comments on commit 3d0ba02

Please sign in to comment.