Skip to content

Commit

Permalink
LEXIO-38100 Don't deepcopy expression in alias method (#12)
Browse files Browse the repository at this point in the history
* nocopy

* Version bumped to 0.12.0

Co-authored-by: ns-circle-ci <[email protected]>
  • Loading branch information
jdrake and ns-circle-ci authored May 26, 2022
1 parent e7ad07e commit 78f2c84
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pysaql"
version = "0.11.0"
version = "0.12.0"
description = "Python SAQL query builder"
authors = ["Jonathan Drake <[email protected]>"]
license = "BSD-3-Clause"
Expand Down
2 changes: 1 addition & 1 deletion pysaql/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Python SAQL query builder"""

__version__ = "0.11.0"
__version__ = "0.12.0"
9 changes: 2 additions & 7 deletions pysaql/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


from abc import ABC, abstractmethod
from copy import deepcopy
from typing import Optional

from .util import escape_identifier
Expand All @@ -20,19 +19,15 @@ class Expression(ABC):
def alias(self, name: str) -> "Expression":
"""Set the alias name
This creates and returns a new expression object so a single field can be
aliased multiple times.
Args:
name: Alias name
Returns:
new expression object with alias
"""
new_expr = deepcopy(self)
new_expr._alias = name
return new_expr
self._alias = name
return self

@abstractmethod
def to_string(self) -> str:
Expand Down

0 comments on commit 78f2c84

Please sign in to comment.