From e02ab3c6522c3903d6532d0b2c3a97b3cea13731 Mon Sep 17 00:00:00 2001 From: spongini Date: Sat, 15 Oct 2022 20:21:41 +0300 Subject: [PATCH 1/2] Adding alias to PseudoColumn --- pypika/terms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypika/terms.py b/pypika/terms.py index c522550a..37b1f8eb 100644 --- a/pypika/terms.py +++ b/pypika/terms.py @@ -1627,7 +1627,7 @@ def __init__(self, name: str) -> None: self.name = name def get_sql(self, **kwargs: Any) -> str: - return self.name + return f'{self.name} as {self.alias}' class AtTimezone(Term): From f534c17542ecd6bfe05615d55ddb463811c96a06 Mon Sep 17 00:00:00 2001 From: spongini Date: Sun, 16 Oct 2022 20:55:28 +0300 Subject: [PATCH 2/2] adding alias throwgh format_alias_sql --- pypika/terms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypika/terms.py b/pypika/terms.py index 37b1f8eb..46928c4c 100644 --- a/pypika/terms.py +++ b/pypika/terms.py @@ -1627,7 +1627,7 @@ def __init__(self, name: str) -> None: self.name = name def get_sql(self, **kwargs: Any) -> str: - return f'{self.name} as {self.alias}' + return format_alias_sql(self.name, self.alias, **kwargs) class AtTimezone(Term):