Skip to content

Commit 71aa367

Browse files
committed
rename func dict
1 parent 08d16b8 commit 71aa367

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

sqlglot/dialects/dialect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ class Dialect(metaclass=_Dialect):
558558
Whether a UUID is considered a string or a UUID type.
559559
"""
560560

561-
FUNCTIONS_COLUMN_NAMES: t.Dict[t.Type[exp.Func], t.Union[str, t.Tuple[str, ...]]] = {}
561+
DEFAULT_FUNCTIONS_COLUMN_NAMES: t.Dict[t.Type[exp.Func], t.Union[str, t.Tuple[str, ...]]] = {}
562562
"""
563563
Maps function expressions to their default output column name(s).
564564
"""

sqlglot/dialects/postgres.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class Postgres(Dialect):
300300
TABLESAMPLE_SIZE_IS_PERCENT = True
301301
SUPPORTS_TABLES_REFERENCED_AS_COLUMNS = True
302302

303-
FUNCTIONS_COLUMN_NAMES = {
303+
DEFAULT_FUNCTIONS_COLUMN_NAMES = {
304304
exp.ExplodingGenerateSeries: "generate_series",
305305
}
306306

sqlglot/optimizer/qualify_tables.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ def _qualify(table: exp.Table) -> None:
9999
if isinstance(source.this, exp.Func):
100100
table_alias = source.args.get("alias")
101101
if not table_alias:
102-
function_columns = dialect.FUNCTIONS_COLUMN_NAMES.get(type(source.this))
102+
function_columns = dialect.DEFAULT_FUNCTIONS_COLUMN_NAMES.get(
103+
type(source.this)
104+
)
103105
exp.alias_(
104106
source,
105107
next_alias_name(),

0 commit comments

Comments
 (0)