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__(
297297 self ,
298298 max_download_threads : int ,
299299 ssl_options : SSLOptions ,
300- schema_bytes : bytes ,
300+ schema_bytes : Optional [ bytes ] = None ,
301301 lz4_compressed : bool = True ,
302302 description : Optional [List [Tuple ]] = None ,
303303 ):
@@ -406,6 +406,8 @@ def next_n_rows(self, num_rows: int) -> "pyarrow.Table":
406406
407407 def _create_empty_table (self ) -> "pyarrow.Table" :
408408 """Create a 0-row table with just the schema bytes."""
409+ if not self .schema_bytes :
410+ return pyarrow .Table .from_pydict ({})
409411 return create_arrow_table_from_arrow_file (self .schema_bytes , self .description )
410412
411413 def _create_table_at_offset (self , offset : int ) -> Union ["pyarrow.Table" , None ]:
@@ -549,7 +551,7 @@ def __init__(
549551 super ().__init__ (
550552 max_download_threads = max_download_threads ,
551553 ssl_options = ssl_options ,
552- schema_bytes = b"" ,
554+ schema_bytes = None ,
553555 lz4_compressed = lz4_compressed ,
554556 description = description ,
555557 )
You can’t perform that action at this time.
0 commit comments