Skip to content

Conversation

@bdgregg
Copy link
Contributor

@bdgregg bdgregg commented Jan 27, 2026

Added function to handle boolean true/false on parameters. Changed parameter requirements. Checked for existence of manifest.xlsx sheet before attempting to work with it. Changed assumption that 'id' column was the first column in the sheet. Added some parameter error checking. Added additional spacing between functions.

@bdgregg bdgregg requested a review from ojas-uls-dev January 27, 2026 16:40
Copy link

@ojas-uls-dev ojas-uls-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Slight nitpick added as comment though, but it should be inconsequential.

def copy_xslx_to_batch(batch_path):
print(f"Copying spreadsheet to {batch_path}/manifest.xlsx")
shutil.copyfile(args.xls_file, batch_path+"/manifest.xlsx")
if os.path.isfile(batch_path+"/manifest.xlsx"):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

batch_path+/manifest.xslx can fail on windows (which may or may not be a concern). Standard way to create paths is either by using os.path.join or Path(batch_path) / "manifest.xslx" where Path is imported as from pathlib import Path

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, while 99.999% of the time this check will work as intended, if the file is removed (usually by another script or cron job) after this line is executed, shutil.copyfile will run anyway and raise an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants