I'm unclear what should maybe_encode(format"TXT", df::DataFrame) and maybe_encode(format"SHA256", df::DataFrame) behave. The current behavior is maybe_encode(fmt, string(df))
Converting it using string can be prune to show changes. Hence I suggest we do something like
function maybe_encode(::Type{DataFormat{:TXT}}, df::DataFrame)
save("tmp.csv", df)
_ignore_crlf(read(String, "tmp.csv"))
end
function maybe_encode(::Type{DataFormat{:SHA256}}, df::DataFrame)
save("tmp.csv", df)
bytes2hex(sha256(read("tmp.csv")))
end
@oxinabox if you like this idea, I can make a PR for this change.
This is a sub PR of #61
Changes:
_convert
tomaybe_encode
maybe_encode
I'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
string
can be prune toshow
changes. Hence I suggest we do something like@oxinabox if you like this idea, I can make a PR for this change.