summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2022-09-25 16:37:15 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2022-09-25 21:14:48 -0400
commitc86ec8f8c98b756ef06933174a3f4a0f3cfbed41 (patch)
tree35535594dd1b6436a12f69797464f8e2c090e904 /lib/sqlalchemy/dialects/postgresql
parent75ab50869b37368f32ec311dfb59777c0c1d1edb (diff)
downloadsqlalchemy-c86ec8f8c98b756ef06933174a3f4a0f3cfbed41.tar.gz
`aggregate_order_by` now supports cache generation.
also adjusted CacheKeyFixture to be a general purpose fixture so that sub-components / dialects can run their own cache key tests. Fixes: #8574 Change-Id: I6c66107856aee11e548d357cea77bceee3e316a0
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/ext.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/ext.py b/lib/sqlalchemy/dialects/postgresql/ext.py
index 0192cf581..ebaad2734 100644
--- a/lib/sqlalchemy/dialects/postgresql/ext.py
+++ b/lib/sqlalchemy/dialects/postgresql/ext.py
@@ -5,8 +5,10 @@
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: ignore-errors
+from __future__ import annotations
from itertools import zip_longest
+from typing import TYPE_CHECKING
from .array import ARRAY
from ...sql import coercions
@@ -16,6 +18,10 @@ from ...sql import functions
from ...sql import roles
from ...sql import schema
from ...sql.schema import ColumnCollectionConstraint
+from ...sql.visitors import InternalTraversal
+
+if TYPE_CHECKING:
+ from ...sql.visitors import _TraverseInternalsType
class aggregate_order_by(expression.ColumnElement):
@@ -56,7 +62,11 @@ class aggregate_order_by(expression.ColumnElement):
__visit_name__ = "aggregate_order_by"
stringify_dialect = "postgresql"
- inherit_cache = False
+ _traverse_internals: _TraverseInternalsType = [
+ ("target", InternalTraversal.dp_clauseelement),
+ ("type", InternalTraversal.dp_type),
+ ("order_by", InternalTraversal.dp_clauseelement),
+ ]
def __init__(self, target, *order_by):
self.target = coercions.expect(roles.ExpressionElementRole, target)