-
Notifications
You must be signed in to change notification settings - Fork 646
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
Printformatting #914
Merged
Merged
Printformatting #914
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This branch is for evaluating the possibility of using ColumnPrintFormatters to optionally format output. There will be a writeOption called ```usePrintFormatters(boolean)``` that turns the logic on or off. It will be off by default, matching the current status. The print formatter is set on the column and would then be used by both table.print and table.write, providing more consistent output PrintFormatters have the advantage of handling missing values so the user does not have to worry about them blowing up a Java NumberFormatter for instance, while allowing the user to set the missing value symbol for each column.
…onal tests, renamed methods
added test for InstantColumn formatting removed TODO
removed one unused line
benmccann
approved these changes
Apr 28, 2021
SonarCloud Quality Gate failed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Deprecated support in CsvWriter for writing Date and DateTime columns using Java's DateTimeFormatter directly.
Replaced them with a new option usePrintFormatters(Boolean) that tells CsvWriter to use any printFormatters defined on all types of columns, unifying the output created by printAll() and other toString() variations with the writing of delimited text files. The new approach also handles missing values flexibly.
If this looks ok, I will add support for the other file output types using WriteOptions: html, json, fixed-width. I'm not really sure how the excel writing works, and i'm happy that way.
The sonar failure is sonar being stupid. It says I should remove the deprecated code some day. Which is true, but not a failure or code-smell today.
Testing
I added 10 tests