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

Loading / saving features doesn't support file-like objects as input #73

Closed
rwedge opened this issue Jan 19, 2018 · 3 comments · Fixed by #566
Closed

Loading / saving features doesn't support file-like objects as input #73

rwedge opened this issue Jan 19, 2018 · 3 comments · Fixed by #566
Labels
good first issue Good for newcomers

Comments

@rwedge
Copy link
Contributor

rwedge commented Jan 19, 2018

Currently Featuretools supports saving a list of features to disk and loading them from disk using a file path as an input. If these functions supported file-like objects as an alternate input we could save features to string buffers or unnamed temporary files.

@rwedge rwedge changed the title Loading/saving features doesn't support file-like objects as input Loading / saving features doesn't support file-like objects as input Jan 19, 2018
@rwedge rwedge added the enhancement Improvement to an existing feature label Jan 22, 2018
@bschreck
Copy link
Contributor

bschreck commented Jan 22, 2018

It would be great if we could also have the option to serialize to a string rather than a file-like object using cloudpickle.dumps(), cloudpickle.loads(). Maybe if the file parameter is omitted.

This is similar to how pandas.DataFrame.to_csv() works: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_csv.html

@kmax12 kmax12 added good first issue Good for newcomers help wanted and removed enhancement Improvement to an existing feature labels Mar 26, 2019
@kmax12
Copy link
Contributor

kmax12 commented Apr 3, 2019

a related question was recently asked about on stackoverflow. I left potential workaround for the S3 case: https://stackoverflow.com/questions/55482233/can-feature-tools-save-feature-list-directly-to-s3/55486555#55486555.

this issue could be extended to also handle writing to s3 if the filepath begins with s3://

@rwedge
Copy link
Contributor Author

rwedge commented May 28, 2019

To summarize the expected calls:

  • Returns the serialized features as a string
ft.save_features(features) 
  • Saves the serialized features as a file
ft.save_features(features, '/path/to/save/to.txt')
  • Save the features to open file f
ft.save_features(features, f)
  • Save the features to s3 file
ft.save_features(features, "s3://bucket/file.txt")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants