Skip to content

Commit

Permalink
Use total returned from write_parquet_metadata (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu authored Jul 31, 2024
1 parent 33b89b2 commit f15c21d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/hipscat_import/soap/run_soap.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,11 @@ def run(args, client):
# All done - write out the metadata
with resume_plan.print_progress(total=4, stage_name="Finishing") as step_progress:
if args.write_leaf_files:
parquet_metadata.write_parquet_metadata(
total_rows = parquet_metadata.write_parquet_metadata(
args.catalog_path,
storage_options=args.output_storage_options,
)
total_rows = 0
metadata_path = paths.get_parquet_metadata_pointer(args.catalog_path)
for row_group in parquet_metadata.read_row_group_fragments(
metadata_path,
storage_options=args.output_storage_options,
):
total_rows += row_group.num_rows
partition_join_info = PartitionJoinInfo.read_from_file(
metadata_path, storage_options=args.output_storage_options
)
Expand All @@ -72,7 +66,6 @@ def run(args, client):
args.tmp_path, args.catalog_path, args.output_storage_options
)
step_progress.update(1)
total_rows = int(total_rows)
catalog_info = args.to_catalog_info(total_rows)
write_metadata.write_provenance_info(
catalog_base_dir=args.catalog_path,
Expand Down

0 comments on commit f15c21d

Please sign in to comment.