File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ def __init__(
297
297
self ,
298
298
max_download_threads : int ,
299
299
ssl_options : SSLOptions ,
300
- schema_bytes : bytes ,
300
+ schema_bytes : Optional [ bytes ] = None ,
301
301
lz4_compressed : bool = True ,
302
302
description : Optional [List [Tuple ]] = None ,
303
303
):
@@ -406,6 +406,8 @@ def next_n_rows(self, num_rows: int) -> "pyarrow.Table":
406
406
407
407
def _create_empty_table (self ) -> "pyarrow.Table" :
408
408
"""Create a 0-row table with just the schema bytes."""
409
+ if not self .schema_bytes :
410
+ return pyarrow .Table .from_pydict ({})
409
411
return create_arrow_table_from_arrow_file (self .schema_bytes , self .description )
410
412
411
413
def _create_table_at_offset (self , offset : int ) -> Union ["pyarrow.Table" , None ]:
@@ -549,7 +551,7 @@ def __init__(
549
551
super ().__init__ (
550
552
max_download_threads = max_download_threads ,
551
553
ssl_options = ssl_options ,
552
- schema_bytes = b"" ,
554
+ schema_bytes = None ,
553
555
lz4_compressed = lz4_compressed ,
554
556
description = description ,
555
557
)
You can’t perform that action at this time.
0 commit comments