Skip to content

Merging google sheets logic #1#3

Open
ojas-uls-dev wants to merge 45 commits intomasterfrom
sheets-logic
Open

Merging google sheets logic #1#3
ojas-uls-dev wants to merge 45 commits intomasterfrom
sheets-logic

Conversation

@ojas-uls-dev
Copy link

Merging google sheets logic

@ojas-uls-dev
Copy link
Author

see also issue #1

Copy link
Member

@ctgraham ctgraham left a comment

Choose a reason for hiding this comment

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

Some questions and some change requests.

ojas-uls-dev and others added 4 commits February 10, 2026 12:18
…ment, when before it was inherited from parent namespace
Remove specific file patterns from .gitignore.
Updated path handling to use os.path.sep for cross-platform compatibility.
Removed commented-out print statement and condition check related to debugging.
@bdgregg bdgregg requested a review from ctgraham February 11, 2026 14:57
@bdgregg
Copy link
Contributor

bdgregg commented Feb 12, 2026

Tested the script to use either a spreadsheet or Google Sheet. currently the script functions as expected.

Copy link
Author

@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.

Aside from what clinton mentioned about the erroneous print statement, it looks correct

make-batch-dirs Outdated
Copy link
Author

Choose a reason for hiding this comment

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

i see the difference between docs and logic, so I'll fix that. It seems like the code is copying file provided by args.xls_file to manifest_path i.e. batch_path/manifest.xslx. This should work fine if args.xls_file exists but manifest.xsl does not exist

make-batch-dirs Outdated

Choose a reason for hiding this comment

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

  1. append() will keep allocating more memory, so it might risk a MemoryError if the sheet contain huge data. If sheet_value_arr is not referred in other place, might directly stream rows from openpyxl to CSV.
    2 writer.writerow() could be failed, it might be betterto wrap the overall workflow in try/except,

logger.error(f"Error: Google arguments are required when using Google Sheets.")
exit()
# Else we are using a Spreadsheet...
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can add some error checking around if args.xls_file exists or not before trying to read the xlsx file.

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.

Add google sheets support to make-batch-dir

4 participants

Comments