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

Preserve user-specified file extensions when loading and saving #69

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

Conversation

hdante
Copy link

@hdante hdante commented May 3, 2023

Fixes issue #61.

This patch changes the behavior of the read*() and write*() functions to allow passing file names with different suffixes.

As a consequence, the patch also fixes the FileNotFoundError exception when loading files with the ".parq" and ".parquet" suffixes.

Overall, the new behavior of the functions is the following:

  • Passing file names without suffixes: behavior stays the same (file format is deduced by the data type where applicable).
  • Passing file names with the default suffixes for some corresponding table type: behavior stays the same.
  • Passing file names with non-default suffixes for some corresponding table type: user-defined suffix is now preserved and is not overwritten anymore.

This patch changes the behavior of the read*() and write*() functions to
allow passing file names with different suffixes.

As a consequence, the patch also fixes the FileNotFoundError exception
when loading files with the ".parq" and ".parquet" suffixes.

Overall, the new behavior of the functions is the following:

- Passing file names without suffixes: behavior stays the same (file
  format is deduced by the data type where applicable).
- Passing file names with the default suffixes for some corresponding
  table type: behavior stays the same.
- Passing file names with non-default suffixes for some corresponding
  table type: user-defined suffix is now preserved and is not
  overwritten anymore.
@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Patch coverage: 90.47% and project coverage change: -0.33 ⚠️

Comparison is base (b0b6268) 100.00% compared to head (5a0815c) 99.67%.

Additional details and impacted files
@@             Coverage Diff             @@
##              main      #69      +/-   ##
===========================================
- Coverage   100.00%   99.67%   -0.33%     
===========================================
  Files            8        8              
  Lines          618      623       +5     
===========================================
+ Hits           618      621       +3     
- Misses           0        2       +2     
Flag Coverage Δ
unittests 99.67% <90.47%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/tables_io/ioUtils.py 99.28% <90.47%> (-0.72%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@eacharles eacharles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to approve and merge this, and then fix up the coverage...

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