-
Notifications
You must be signed in to change notification settings - Fork 55
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(engine): prettier prints in report method #25
Conversation
src/ydata_quality/core/warnings.py
Outdated
@@ -33,6 +33,19 @@ def __str__(self): | |||
return f"Priority {self.value}: {_descriptions[self.value]}" | |||
|
|||
|
|||
class WarningStyling: | |||
PRIORITIES = { |
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.
These are the colorcodes for the priority levels.
@@ -107,14 +107,16 @@ def report(self): | |||
"Prints a report containing all the warnings detected during the data quality analysis." | |||
self.__clean_warnings() | |||
if not self._warnings: | |||
print('No warnings found.') | |||
print(f'{WarningStyling.OKAY}No warnings found.{WarningStyling.ENDC}') |
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.
This small rework mimics the proposed structure in warnings pretty print task (notion)
The new version is leaner (I personally prefer it over the first one). |
fe40039
to
e5c71d1
Compare
Added WarningStyle class with ANSI a series of relevant font customization codes:
Reworked the report method, making it leaner and better structured, for engines and DataQuality.