Skip to content
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

Merged
merged 5 commits into from
Sep 22, 2021

Conversation

jfsantos-ds
Copy link
Contributor

Added WarningStyle class with ANSI a series of relevant font customization codes:

  • Priority colors according to level
  • Bolds, underlines
  • Style termination code

Reworked the report method, making it leaner and better structured, for engines and DataQuality.

@jfsantos-ds jfsantos-ds added refactor A code change that neither fixes a bug nor adds a feature style Further information is requested labels Sep 17, 2021
@jfsantos-ds jfsantos-ds self-assigned this Sep 17, 2021
@@ -33,6 +33,19 @@ def __str__(self):
return f"Priority {self.value}: {_descriptions[self.value]}"


class WarningStyling:
PRIORITIES = {
Copy link
Contributor Author

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.

A visual color map can be found here

@@ -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}')
Copy link
Contributor Author

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)

@jfsantos-ds
Copy link
Contributor Author

The new version is leaner (I personally prefer it over the first one).

local_tests/test_warnings.py Outdated Show resolved Hide resolved
@UrbanoFonseca UrbanoFonseca merged commit c831709 into master Sep 22, 2021
@UrbanoFonseca UrbanoFonseca deleted the feat/pretty_prints branch September 22, 2021 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor A code change that neither fixes a bug nor adds a feature style Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants