-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat 85: validate & format datetime in xlsx job template #87
Conversation
@@ -16,6 +16,7 @@ class JobUploadTemplate: | |||
|
|||
FILE_NAME = "job_upload_template.xlsx" | |||
NUM_TEMPLATE_ROWS = 20 | |||
XLSX_DATETIME_FORMAT = "yyyy-mm-dd hh:mm:ss" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISO format is typically represented at YYYY-MM-DDTHH:mm:ss
although I'm not sure how excel does it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both work in excel as custom formats and pass the regex check from BasicUploadJobConfigs._DATETIME_PATTERN1
I tried to match the ValueError raised in BasicUploadJobConfigs._parse_datetime
and what we have in the sample csvs, but I'm happy to change it to YYYY-MM-DDTHH:mm:ss
instead. What do you think?
aind-data-transfer-service/src/aind_data_transfer_service/configs/job_configs.py
Lines 261 to 263 in 6ad277a
raise ValueError( | |
"Incorrect datetime format, should be" | |
" YYYY-MM-DD HH:mm:ss or MM/DD/YYYY I:MM:SS P" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should handle both the space and the 'T' but use the YYYY-MM-DDTHH:mm:ss
for the XLSX_DATETIME_FORMAT
if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
closes #85
acq_datetime
column to check input is valid date