-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse out subseconds from WARC-Date longer than six digits
- Loading branch information
Showing
2 changed files
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b76135a
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.
This can be improved but works to convert a 7-9 digit WARC-Date to digits. Moved away from saying "14 digits" since more precision will be had with the addition of milliseconds.
Feedback, @ibnesayeed? Please note the date string in the last CDXJ line.
b76135a
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.
I think we can do something simpler here, but I need to think about potential implications. As an aside, there is another opportunity to use f-string in this commit.
b76135a
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.
I was unsure whether the string execution in an f-string would behave correctly, so opted for format after initially using an f-string.
Alternative approaches might be to initially rely on the string length and check validity from there. Feel free to propose something else but this is working for now. I'll continue looking into replay handling these long datestrings.
b76135a
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.
I was thinking more in the direction of using a RegEx with certain defaults to isolate pieces and the then format the time from there.
b76135a
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.
I thought about that approach, too. I don't think there is any issue with doing it that way but some of the logic will need to be re-written.