-
Notifications
You must be signed in to change notification settings - Fork 68
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
feat: Introduce FormattingConfig
and deprecate DefaultFormats
#127
Merged
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
@SemyonSinchenko I have some more ideas for improvements based on your feedback. Will change it to a draft PR and get back to you soon! |
fpgmaas
changed the title
feat: Introduce
feat: Introduce Jul 18, 2024
TerminalStringFormatter
and FormattingConfig
TerminalStringFormatter
and FormattingConfig
and deprecate DefaultFormats
wip wip functioning unit tests fix fix fix add import fix fix mutable defaults fix mutable defaults moved format-parsing logic to FormattingConfig class make backwards compatible fix init add docstring changed TerminalStringFormatter class into a function
move dict parsing logic to format class inherit Enum from str rename string formatter simplify
fpgmaas
changed the title
feat: Introduce
feat: Introduce Jul 19, 2024
TerminalStringFormatter
and FormattingConfig
and deprecate DefaultFormats
FormattingConfig
and deprecate DefaultFormats
SemyonSinchenko
approved these changes
Jul 19, 2024
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.
LGTM! I left one minor comment, feel free to merge it.
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.
PR Checklist
docs
is updatedDescription of changes
This PR proposes to deprecate the existing methods of configuring the output format of
chispa
through the use of theDefaultFormats
and arbitrary dataclasses. Currently there are a few issues with this approach;As an alternative, this PR proposes to replace it with the classes
Color
,Style
,Format
, andFormattingConfig
, so it can be used asor
or similarly:
This brings:
Notes
mypy
. This PR also adds the linefrom __future__ import annotations
to all files through the use of ruff, to provide type hinting compatiblity in Python 3.8 and 3.9test_deprectaed.py
.assert_basic_rows_equality(df1.collect(), df2.collect(), formats=CustomFormats())
will displayassert_basic_rows_equality(df1.collect(), df2.collect(), formats=DefaultFormats())
will display