From 58113cc23a0a2b6134c598832181ae69f4519095 Mon Sep 17 00:00:00 2001 From: Justin Joyce Date: Tue, 31 Jan 2023 18:04:43 +0000 Subject: [PATCH] #750 --- opteryx/utils/colors.py | 5 +++-- opteryx/utils/display.py | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/opteryx/utils/colors.py b/opteryx/utils/colors.py index e543b3fd..98815573 100644 --- a/opteryx/utils/colors.py +++ b/opteryx/utils/colors.py @@ -4,11 +4,12 @@ "\001PUNCm": "\033[38;5;237m", "\001VARCHARm": "\033[38;5;227m", "\001CONSTm": "\033[38;5;117m", - "\001VALUEm": "\033[38;5;170m", + "\001NULLm": "\033[38;5;170m", + "\001VALUEm": "\033[38;5;12m", "\001NUMERICm": "\033[38;5;203m", "\001DATEm": "\033[38;5;72m", "\001TIMEm": "\033[38;5;150m", - "\001KEYm": "\033[38;5;26m", + "\001KEYm": "\033[38;5;32m", # Regular Colors "\001BLACKm": "\033[0;30m", # Black "\001REDm": "\033[0;31m", # Red diff --git a/opteryx/utils/display.py b/opteryx/utils/display.py index 60ad35a6..8527ff6c 100644 --- a/opteryx/utils/display.py +++ b/opteryx/utils/display.py @@ -141,8 +141,10 @@ def ascii_table( def type_formatter(value, width): - if value is None or isinstance(value, bool): - return "\001CONSTm" + str(value).center(width)[:width] + "\001OFFm" + if value is None: + return "\001NULLm" + str(value).rjust(width)[:width] + "\001OFFm" + if isinstance(value, bool): + return "\001CONSTm" + str(value).rjust(width)[:width] + "\001OFFm" if isinstance(value, int): return "\001NUMERICm" + str(value).rjust(width)[:width] + "\001OFFm" if isinstance(value, float):