Skip to content
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

timestamp_format raises an exception #1249

Merged
merged 7 commits into from
Nov 7, 2019
Merged

Conversation

nklever
Copy link
Contributor

@nklever nklever commented Oct 30, 2019

timestamp_format e.g. "%Y-%m-%d-%H-%M-%S-%f" raises an exception ValueError('Unknown string format:', '2019-10-24-20-25-53-460007') in dateutil.parser.parse during collect of submissions. This is due to the dependency of dateutil.parser.parse in parse_utc(). To avoid this during collection of submission, this PR will validate the timestamp_format against dateutils parsing algorithm and raises a TraitError if a ValueError in dateutil.parser.parse occurs.

It is allowed to change the timestamp format in nbgrader_config.py. But e.g. c.Exchange.timestamp_format = "%Y-%m-%d-%H-%M-%S-%f" will raise a ValueError('Unknown string format:', '2019-10-24-20-25-53-460007') in dateutil.parser.parse during collect of submissions. This is due to the new dependency of dateutil.parser.parse in parse_utc().
To avoid this during collection of submission, the above code will check the timestamp_format against dateutils parsing algorithm and raises an configuration error.
It is allowed to change the timestamp format in nbgrader_config.py. But e.g. c.Exchange.timestamp_format = "%Y-%m-%d-%H-%M-%S-%f" will raise a ValueError('Unknown string format:', '2019-10-24-20-25-53-460007') in dateutil.parser.parse during collect of submissions. This is due to the new dependency of dateutil.parser.parse in parse_utc().
To avoid this during collection of submission, the above code will check the timestamp_format against dateutils parsing algorithm and raises an configuration error.
ValueError('Unknown string format:', '2019-10-24-20-25-53-460007')
in dateutil.parser.parse during collect of submissions.
This is due to the dependency of dateutil.parser.parse in parse_utc().
To avoid this during collection of submission, this code will
validate the timestamp_format against dateutils parsing algorithm
and raises a TraitError if a ValueError occurs.
@nklever
Copy link
Contributor Author

nklever commented Oct 30, 2019

PR #1245 has to be merged prior to the CI-checks to avoid the build fails in AppVeyor and Travis CI above

Copy link
Member

@jhamrick jhamrick left a comment

Choose a reason for hiding this comment

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

Thanks a lot! If you could just do a rebase (and make the one change I suggested) I think this is good to merge.

@jhamrick jhamrick added the bugfix label Nov 2, 2019
@jhamrick jhamrick added this to the 0.6.1 milestone Nov 2, 2019
Copy link
Member

@jhamrick jhamrick left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! Looks like the tests are failing though, I think because the import from dateutil isn't quite right.

@jhamrick jhamrick modified the milestones: 0.6.1, 0.6.2 Nov 6, 2019
Yes, obviously a typical typo !
Excuse my laxness !

Co-Authored-By: Jessica B. Hamrick <jessica.b.hamrick@gmail.com>
@nklever nklever requested a review from jhamrick November 7, 2019 18:57
@nklever
Copy link
Contributor Author

nklever commented Nov 7, 2019

Hi Jessica,
I can't interprete the failure status in codecov/patch - do you ?
Or might it be a problem of codecov/patch as stated in the issue of kata-containers ?

Copy link
Member

@jhamrick jhamrick left a comment

Choose a reason for hiding this comment

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

Thanks! I'm not too worried about the failing patch changes; I'll go ahead and merge it as is :)

@jhamrick jhamrick merged commit 6065f3d into jupyter:master Nov 7, 2019
@jhamrick
Copy link
Member

jhamrick commented Nov 7, 2019

@meeseeksdev backport to 0.6.x

meeseeksmachine pushed a commit to meeseeksmachine/nbgrader that referenced this pull request Nov 7, 2019
jhamrick added a commit that referenced this pull request Nov 8, 2019
…9-on-0.6.x

Backport PR #1249 on branch 0.6.x (timestamp_format raises an exception)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants