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

Improvement: allow many files when using csv_input from tfx.utils.dsl_utils #28

Closed
Efaq opened this issue Apr 3, 2019 · 8 comments
Closed
Assignees
Labels

Comments

@Efaq
Copy link

Efaq commented Apr 3, 2019

When creating a pipeline to load data from csv, the function tfx.utils.dsl_utils.csv_input(uri) is used. Both from the documentation and from own tests, I noticed that it is not possible to have multiple csv files inside the folder.

I think it is a good feature to be able to have an arbitrary number of csv files inside the folder, and the reader function could put the data together. Some check to ensure that the header is the same for all csvs should be done.

The use case is to skip joining datasets outside of the framework: one could simply add a new csv inside the folder and the next pipeline execution would pick that up together with the rest of the data.

@1025KB
Copy link
Collaborator

1025KB commented Apr 8, 2019

Thanks for the suggestion! we are working on it.

Other than supporting multiple files in the directory, we are also working on supporting new data span and data version which seems fit to your use case

@Efaq
Copy link
Author

Efaq commented Apr 9, 2019

It sounds really great, thank you!

@1025KB
Copy link
Collaborator

1025KB commented Apr 9, 2019

I will keep this open as a feature request, Thanks!

@krazyhaas krazyhaas added the good first issue Good for newcomers label May 21, 2019
@zhitaoli
Copy link
Contributor

Just to clarify, after 0.13.0 CSVExamplegen should be able to handle multiple CSV files for the same span and version.

@Efaq, I cannot tell from your last sentence whether you want new csv file be processed with other ones as a whole, or incrementally processing that (which falls into "continuous training" story that we have not released yet). If you think this is enough, we can improve the user guide and close this issue. Otherwise, I'd like to clarify the scope of the issue a bit further.

@Efaq
Copy link
Author

Efaq commented May 23, 2019

@zhitaoli The continuous training scenario is interesting, but at the moment my issue is only about having multiple csv files treated as one, so we don't need to manually join multiple csvs. So same span and version. If this is in place for 0.13.0 then it's good enough for me.

But regarding new data span and version, do you know what is in the road map?

Thank you!

@zhitaoli
Copy link
Contributor

@1025KB Can you update the docs/guide/examplegen.md to explain how to use multiple CSV files, then close this ticket? Thanks.

@1025KB
Copy link
Collaborator

1025KB commented May 31, 2019

the ExampleGen tfx.utils.dsl_utils.csv_input can take folder path now,

also if you want to use regex for path, you can specify the input_config with a single split
check here for instruction

@1025KB 1025KB closed this as completed May 31, 2019
@mfjackson
Copy link

mfjackson commented Aug 30, 2019

@zhitaoli I appreciate your work on this! However, could you explain what you mean by csv files having the same span and version? Using v0.13.0, I split the taxi data from the developer tutorial into two separate csv's, both with the same headers and schema, and attempted to load them using CsvExampleGen, but get the following RunTimeError in the x.CsvExampleGen.exec logs:

ERROR - Only one file per dir is supported

The csv_input is directed towards the appropriate folder with the data and the CsvExampleGen runs successfully with just one of the csv files present, so it appears as though it is multiple csv files that are causing the error. Do you have an idea of what might be happening?

Thanks!

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

No branches or pull requests

6 participants