Skip to content

Commit

Permalink
Move mkdir out of parallelized loop
Browse files Browse the repository at this point in the history
  • Loading branch information
nalinigans committed Dec 27, 2024
1 parent 61c18a4 commit 0e22d5c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/genomicsdb_query
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,6 @@ def process(config):
with open(output_config.filename, "wb") as f:
f.write(json_output)
elif output_config.type == "arrow":
parent_dir = os.path.dirname(output_config.filename)
if not os.path.exists(parent_dir):
os.mkdir(parent_dir)
nbytes = 0
writer = None
i = 0
Expand Down Expand Up @@ -443,6 +440,8 @@ def main():
json_type = parse_args_for_json_type(args.json_output_type)
max_arrow_bytes = -1
if output_type == "arrow":
if not os.path.exists(output):
os.mkdir(output)
max_arrow_bytes = parse_args_for_max_bytes(args.max_arrow_byte_size)
print(f"Using {args.max_arrow_byte_size} number of bytes as hint for writing out parquet files")

Expand Down

0 comments on commit 0e22d5c

Please sign in to comment.