From: Mike Bayer Date: Mon, 20 Sep 2021 19:16:56 +0000 (-0400) Subject: implement _all_selected_columns for functionelement X-Git-Tag: rel_1_4_24~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3995db5b5ec550b8208efe34df35649c131fde45;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git 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 --- 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):