From c12d45077a992e9d5d21bc891d4961c9a2ff73f6 Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Fri, 12 Apr 2024 14:02:15 +0300 Subject: [PATCH] show pg and athena column comments and table descriptions as antd tooltip if they are defined (#6582) * show column comments by default for athena and postgres * Restyled by prettier * fixed typo * fmt fix * ordered imports * fixed unit tests * fixed tests for athena --------- Co-authored-by: Andrew Chubatiuk Co-authored-by: Restyled.io Co-authored-by: Andrii Chubatiuk --- .../app/components/queries/SchemaBrowser.jsx | 74 +++++++++++++------ redash/models/__init__.py | 11 ++- redash/query_runner/athena.py | 39 ++++++++-- redash/query_runner/pg.py | 18 ++++- tests/models/test_data_sources.py | 20 +++-- tests/query_runner/test_athena.py | 23 +++++- 6 files changed, 142 insertions(+), 43 deletions(-) diff --git a/client/app/components/queries/SchemaBrowser.jsx b/client/app/components/queries/SchemaBrowser.jsx index ed8d2402ed..730f4acf88 100644 --- a/client/app/components/queries/SchemaBrowser.jsx +++ b/client/app/components/queries/SchemaBrowser.jsx @@ -16,6 +16,7 @@ import LoadingState from "../items-list/components/LoadingState"; const SchemaItemColumnType = PropTypes.shape({ name: PropTypes.string.isRequired, type: PropTypes.string, + comment: PropTypes.string, }); export const SchemaItemType = PropTypes.shape({ @@ -47,13 +48,30 @@ function SchemaItem({ item, expanded, onToggle, onSelect, ...props }) { return (
- -