Merged
Conversation
* add tests for maybe_encode * ignore CRLF/LF differences
johnnychen94
commented
Jul 6, 2020
It has no practical usage except that it's conceptually right.
oxinabox
reviewed
Jul 6, 2020
| end | ||
|
|
||
| function query_extended(filename) | ||
| function query_extended(filename::AbstractString) |
Member
Author
There was a problem hiding this comment.
This function expects only string types splitext, I added this to make sure nothing strange is passed here as a safety net.
oxinabox
reviewed
Jul 6, 2020
oxinabox
reviewed
Jul 6, 2020
src/fileio.jl
Outdated
| # Helpers | ||
| _join(x::AbstractArray{<:AbstractString}) = mapreduce(_ignore_crlf, (x,y)->x*"\n"*y, x) | ||
| _sha256(x) = bytes2hex(sha256(x)) | ||
| _ignore_crlf(x::AbstractString) = replace(x, "\r"=>"") |
Member
There was a problem hiding this comment.
Should we just say we are ignoring \r ?
Suggested change
| _ignore_crlf(x::AbstractString) = replace(x, "\r"=>"") | |
| _ignore_linefeed(x::AbstractString) = replace(x, "\r"=>"") |
Member
Author
There was a problem hiding this comment.
I assume you're suggesting Carriage Return (\r) instead of linefeed (\n)?
I renamed to _ignore_CR with additional docstring.
oxinabox
approved these changes
Jul 6, 2020
Co-authored-by: Lyndon White <oxinabox@ucc.asn.au>
Member
Author
|
I'm merging this to avoid possible conflict and save myself some efforts from rebasing. If there're any further comments, I'll address them in future PRs. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a sub PR of #61
Changes:
_converttomaybe_encodemaybe_encodeI'm unclear what should
maybe_encode(format"TXT", df::DataFrame)andmaybe_encode(format"SHA256", df::DataFrame)behave. The current behavior ismaybe_encode(fmt, string(df))Converting it using
stringcan be prune toshowchanges. Hence I suggest we do something like@oxinabox if you like this idea, I can make a PR for this change.