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

Small: Simplifying read_file/write_file for better encapsulation/cohesion #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ScoGroMSFT
Copy link

The read_file and write_file methods required the caller to pass an extension that was lower-case and included a leading period in order to determine whether the contents were parquet or csv. This design leaks expectations of the method to the caller (and relies on custom file path parsing to get the extension, which is usually not ideal.) It is also subject to potential errors where the caller passes the incorrect extension.

This revision simplifies the signature to take the file path and then all logic for determining how to read or write is encapsulated in the read_file/write_file methods.

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.

1 participant