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

Add FSS abstraction to remaining from_* IO functions #649

Merged
merged 5 commits into from
Jul 12, 2023

Conversation

philss
Copy link
Member

@philss philss commented Jul 12, 2023

This is a continuation of #645

PS: I left out the introduction of endpoint / base_url to another PR.


defp normalise_entry(filepath, _config) when is_binary(filepath) do
if File.exists?(filepath) do
%Local.Entry{path: filepath}
{:ok, %Local.Entry{path: filepath}}
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member

@josevalim josevalim left a 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!

@philss philss merged commit 0d24a1b into main Jul 12, 2023
@philss philss deleted the ps-fss-to-all-from_io-ops branch July 12, 2023 15:45
philss added a commit that referenced this pull request Jul 24, 2023
philss added a commit that referenced this pull request Jul 24, 2023
* Normalise IO write functions with FSS entry

This is similar to #649

* Fix typespecs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants