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

Default FSblock write_path/read_path file not CSV #2

Open
mahiki opened this issue Aug 22, 2023 · 1 comment
Open

Default FSblock write_path/read_path file not CSV #2

mahiki opened this issue Aug 22, 2023 · 1 comment

Comments

@mahiki
Copy link
Owner

mahiki commented Aug 22, 2023

Currently LocalFSBlock.write_path() and read_path support read/write of CSV files via CSV.jl package.

This is the main use case for me personally. When saving image files (from plots for example) or other file types this will be a limitation.

Better if default is a generic file writer/reader with CSV as a special case. Questions to answer:

  • Does read_path need to be attached as a Struct method? I was following the Prefect python/OOP design
  • Reading text file with CSV, what happens?
  • How to know what kind of file it is on read, the extension?
  • Same on write

Best follow DataFrames example, CSV.write(df, [sink]).

@mahiki
Copy link
Owner Author

mahiki commented Feb 7, 2024

Reading text file with CSV, what happens?

It loads to dataframe with dummy columns where needed, with number of cols based on row with most commas.
Its not useful, def need to use CSV.read/write as specially selected writer if called from Dataset with file format = "csv".

Maybe read_path/write path should also take the function as an argument. This would not match the Prefect block API.
The block struct is providing a function, this is awkward unless the function is also accepting the reading function as an argument as well. Then Dataset types can automatically provide a CSV.read/write based on the file_format enumerated.

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

No branches or pull requests

1 participant