-
Notifications
You must be signed in to change notification settings - Fork 324
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
CSV Writing #1894
CSV Writing #1894
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things I'd like to see addressed, but mostly looks great!
@@ -41,7 +41,7 @@ from Standard.Base.Data.Number.Extensions export all hiding Math, String, Double | |||
from Standard.Base.Data.Noise export all hiding Noise | |||
from Standard.Base.Data.Pair export Pair | |||
from Standard.Base.Data.Range export Range | |||
from Standard.Base.Data.Text.Extensions export Text, Split_Kind | |||
from Standard.Base.Data.Text.Extensions export Text, Split_Kind, Line_Ending_Style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want this exported by default rather than accessible as Text.Line_Ending_Style
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line_Ending_Style
seems rather clear to me on its own. And Text.Line_Ending_Style
is a looot to type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I'd go with Text.Line_Ending
. What if we ever introduce another kind of line ending style?
example_to_csv = Examples.inventory_table.to_csv | ||
to_csv : Boolean -> Boolean -> Text -> Line_Ending_Style.Line_Ending_Style -> Text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example_to_csv = Examples.inventory_table.to_csv | |
to_csv : Boolean -> Boolean -> Text -> Line_Ending_Style.Line_Ending_Style -> Text | |
example_to_csv = Examples.inventory_table.to_csv | |
to_csv : Boolean -> Boolean -> Text -> Line_Ending_Style.Line_Ending_Style -> Text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't do this, ever :)
- file: the file to write the generated CSV contents to. Note that other | ||
files may be created or written to if `max_rows_per_file` is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the file exists and has contents? You should probably have a should_overwrite
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't do it for any other file-writing method though? So this seems consistent and if we want to change it, we should probably change all places where this could happen. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we probably should have it elsewhere, but not worth it for now. File an issue.
example_to_csv = Examples.inventory_table.write_csv (Enso_Project.data / example_csv_output.csv) | ||
write_csv : File.File -> Boolean -> Boolean -> Text -> Line_Ending_Style.Line_Ending_Style -> Nothing | Integer -> Nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example_to_csv = Examples.inventory_table.write_csv (Enso_Project.data / example_csv_output.csv) | |
write_csv : File.File -> Boolean -> Boolean -> Text -> Line_Ending_Style.Line_Ending_Style -> Nothing | Integer -> Nothing | |
example_to_csv = Examples.inventory_table.write_csv (Enso_Project.data / example_csv_output.csv) | |
write_csv : File.File -> Boolean -> Boolean -> Text -> Line_Ending_Style.Line_Ending_Style -> Nothing | Integer -> Nothing |
Pull Request Description
Writes CSVs.
Important Notes
Checklist
Please include the following checklist in your PR: