-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add a default timezone arg to jsonld import, re yale#9708 #10836
Conversation
@@ -650,6 +650,13 @@ def find_matching_branch(self, k, v, tree_node, result, tile=None, indent=0): | |||
else: | |||
self.printline(f"Could not validate {values} as a {o['datatype']}", indent + 1) | |||
else: | |||
if o["datatype"].datatype_name == 'date': | |||
try: |
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.
try: | |
if self.default_timezone and o["datatype"].datatype_name == 'date': |
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.
Without the try/except block couldn't this fail if the value can't be parsed on this line
datetime.datetime.strptime(value, "%Y-%m-%d %H:%M:%S")
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.
sorry meant my suggestion to be this:
try: | |
if self.default_timezone and o["datatype"].datatype_name == 'date': | |
try: |
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.
looks good
Add timezone flag to jsonld import to indicate timezone for data that may not include a timezone by default, re #9708