From 3995db5b5ec550b8208efe34df35649c131fde45 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 20 Sep 2021 15:16:56 -0400 Subject: [PATCH] implement _all_selected_columns for functionelement Implemented a method in ``FunctionElement`` that is essentially abstract in an ancestor class (even though not used), leading to pylint complaints. Fixes: #7052 Change-Id: Iceeeb332fbb3c7187cd2b1969e2f4233a47136b1 --- doc/build/changelog/unreleased_14/7052.rst | 6 ++++++ lib/sqlalchemy/sql/functions.py | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 doc/build/changelog/unreleased_14/7052.rst diff --git a/doc/build/changelog/unreleased_14/7052.rst b/doc/build/changelog/unreleased_14/7052.rst new file mode 100644 index 0000000000..3c927c333b --- /dev/null +++ b/doc/build/changelog/unreleased_14/7052.rst @@ -0,0 +1,6 @@ +.. change:: + :tags: bug, sql + :tickets: 7052 + + Implemented a method in ``FunctionElement`` that is essentially abstract in + an ancestor class (even though not used), leading to pylint complaints. diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index 900bc6dbaf..5729f81f51 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -297,12 +297,23 @@ class FunctionElement(Executable, ColumnElement, FromClause, Generative): SQL function expressions. """ # noqa E501 + + return ColumnCollection( + columns=[(col.key, col) for col in self._all_selected_columns] + ) + + @property + def _all_selected_columns(self): if self.type._is_table_value: cols = self.type._elements else: cols = [self.label(None)] - return ColumnCollection(columns=[(col.key, col) for col in cols]) + return cols + + @property + def exported_columns(self): + return self.columns @HasMemoized.memoized_attribute def clauses(self): -- 2.47.3