-
Notifications
You must be signed in to change notification settings - Fork 323
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
Adding write support to File_Format.Excel
#3551
Conversation
3b5dca5
to
51a19d7
Compare
std-bits/table/src/main/java/org/enso/table/write/ExcelWriter.java
Outdated
Show resolved
Hide resolved
b85ad70
to
37d6a67
Compare
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.
Thanks for the example with date in CSV files.
for these tests. This should ideally be re-enabled with the | ||
completion of the following story: | ||
https://www.pivotaltracker.com/story/show/181755990 | ||
no_dates = File_Format.Delimited "," value_formatter=(Data_Formatter date_formats=[] time_formats=[] datetime_formats=[]) |
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.
I see. How would one enable parsing of the dates again? Probably by avoiding value_formatter
specification...
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.
exactly - if value_formatter is not set it should automatically parse date in the format of yyyy-MM-dd
Alternatively:
no_dates = File_Format.Delimited "," value_formatter=(Data_Formatter date_formats=['yyyy-MM-dd'] time_formats=[] datetime_formats=[])
would just re-enable dates (leaving DateTimes and Times as 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.
How shall I run the test? I tried:
enso$ ./built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/bin/enso --run test/Table_Tests/src/Excel_Spec.enso
In module Excel_Spec:
Compiler encountered errors:
Excel_Spec.enso[18:1-18:19]: The `project` keyword was used in an import statement, but the module does not belong to a project.
Execution finished with an error: Compilation aborted due to errors.
I deleted the 18th line, but then most of the tests fail.
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.
Need the --in-project
argument:
Windows:
.\bin\enso --ir-caches --run C:\Repos\Enso\ide\test\Table_Tests\src\Excel_Spec.enso --in-project C:\Repos\Enso\ide\test\Table_Tests
distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Existing_File_Behavior.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Table/0.0.0-dev/src/Io/File_Format.enso
Outdated
Show resolved
Hide resolved
std-bits/table/src/main/java/org/enso/table/excel/ExcelRange.java
Outdated
Show resolved
Hide resolved
std-bits/table/src/main/java/org/enso/table/excel/ExcelRow.java
Outdated
Show resolved
Hide resolved
std-bits/table/src/main/java/org/enso/table/write/ExcelWriter.java
Outdated
Show resolved
Hide resolved
std-bits/table/src/main/java/org/enso/table/write/ExcelWriter.java
Outdated
Show resolved
Hide resolved
Test.specify 'should result in Range_Exceeded error if trying to write in too small a range' <| | ||
out.delete_if_exists | ||
(Enso_Project.data / test_sheet_name) . copy_to out | ||
sub_clothes.write out (File_Format.Excel (Cell_Range "Another!A1:B2")) . should_fail_with Range_Exceeded |
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.
Is the target file modified? I'd like the test to check that.
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 could do with a File get_modified_time but as lacking that will hold off adding for now. Will add as part of append.
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.
Looks good to me overall, some comments and questions (possibly for future) in-line.
The major thing that I think should be addressed before merging is that documentation of Existing_File_Behavior.Error
is not consistent with the behavior for Excel files. While I understand the rationale behind the changed behavior, I don't think we can have documentation that is not aligned with the actual behavior as that will greatly confuse the users, so I think we need to figure something out for this case.
- Added File.copy_to - Removed writeSpreadsheetCell. - Added ExcelWriter.
Still to do Range based.
Header Infer based on current
Fix issues with BLANK cells.
…ing_File_Behavior.enso Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
std-bits/table/src/main/java/org/enso/table/write/ExcelWriter.java
Outdated
Show resolved
Hide resolved
4733e64
to
5e0a68e
Compare
…java Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Pull Request Description
Support for writing tables to Excel.
Important Notes
Has custom support for Error mode as will allow appending a new table in this mode to the file.
Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.