-
Notifications
You must be signed in to change notification settings - Fork 123
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 FSS abstraction to remaining from_*
IO functions
#649
Conversation
Also refactor to avoid exception in case the normalisation does not work.
lib/explorer/data_frame.ex
Outdated
|
||
defp normalise_entry(filepath, _config) when is_binary(filepath) do | ||
if File.exists?(filepath) do | ||
%Local.Entry{path: filepath} | ||
{:ok, %Local.Entry{path: filepath}} |
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.
What if we always return it as %Local.Entry{path: filepath}
? Then if it doesn't exist, Polars will fail to read anyway and say the file does not exist. This way we don't need to fiddle with ArgumentError below. Thoughts?
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.
But you mean, remove the result from the normalise_entry/2
entirely? Or just always return {:ok, %Local.Entry{path: filepath}}
for this function clause?
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.
Don't check if the file exists, alwaus return {:ok, ...}
for the function clause.
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.
One tiny comment and ship it!
* Normalise IO write functions with FSS entry This is similar to #649 * Fix typespecs
This is a continuation of #645
PS: I left out the introduction of
endpoint / base_url
to another PR.