Skip to content

Commit

Permalink
(wip) add retries to table write
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinzwang committed Jun 27, 2024
1 parent 7422f2f commit db8fc53
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions daft/table/table_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,17 +788,25 @@ def _write_tabular_arrow_table(
else:
basename_template = f"{uuid4()}-{{i}}.{format.default_extname}"

pads.write_dataset(
arrow_table,
schema=schema,
base_dir=full_path,
basename_template=basename_template,
format=format,
partitioning=None,
file_options=opts,
file_visitor=file_visitor,
use_threads=True,
existing_data_behavior="overwrite_or_ignore",
filesystem=fs,
**kwargs,
)
for _ in range(3):
try:
pads.write_dataset(
arrow_table,
schema=schema,
base_dir=full_path,
basename_template=basename_template,
format=format,
partitioning=None,
file_options=opts,
file_visitor=file_visitor,
use_threads=True,
existing_data_behavior="overwrite_or_ignore",
filesystem=fs,
**kwargs,
)
break
except Exception as e:
print(f"!!!!! ERROR WRITING DATASET !!!!!: {e}")
error = e
else:
raise error

0 comments on commit db8fc53

Please sign in to comment.