Skip to content

Commit

Permalink
in if
Browse files Browse the repository at this point in the history
  • Loading branch information
davedavemckay committed Jan 14, 2025
1 parent d637b70 commit 5a402e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions csd3-side/scripts/lsst-backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ def compare_zip_contents_bool(collate_object_names, id: int, current_objects: pd
dprint(current_objects['METADATA'], flush=True)
dprint(f'cmp bool: {current_objects["METADATA"].isin([cmp]).any()}', flush=True)
if current_objects['METADATA'].isin([cmp]).any():
dprint('in if', flush=True)
existing_zip_contents = current_objects[current_objects['METADATA'].isin([cmp])]['METADATA'].values[0]
dprint(f'existing_zip_contents: {existing_zip_contents}', flush=True)
dprint(f'example: {existing_zip_contents.iloc[362681]}', flush=True)
dprint(f'example: {existing_zip_contents}', flush=True)
if all([x in existing_zip_contents for x in cmp]):
dprint(f'Zip file {destination_dir}/collated_{id}.zip already exists and file lists match - skipping.', flush=True)
return_bool = False
Expand Down Expand Up @@ -1246,10 +1247,10 @@ def process_files(s3, bucket_name, api, current_objects, exclude, local_dir, des
# repeat(current_objects),
# repeat(destination_dir),
# )):
print(f'to_collate on id {id}: {to_collate[to_collate.id == id]["object_names"].values}')
print(f'to_collate on id {id}: {to_collate[to_collate.id == id]["object_names"].values[0]}')
comp_futures.append(client.submit(
compare_zip_contents_bool,
to_collate[to_collate.id == id]['object_names'].values,
to_collate[to_collate.id == id]['object_names'].values[0],
id,
current_objects,
destination_dir,
Expand Down

0 comments on commit 5a402e3

Please sign in to comment.