Skip to content

Commit

Permalink
Merge pull request #2212 from moj-analytical-services/improve_perform…
Browse files Browse the repository at this point in the history
…ance_of_sql_generation

Improve performance of SQL generation by using deepcopy less
  • Loading branch information
RobinL authored Jun 18, 2024
2 parents ee88655 + d11d964 commit 7b70d6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions splink/input_column.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from copy import deepcopy
from copy import copy
from dataclasses import dataclass, replace

import sqlglot
Expand Down Expand Up @@ -216,20 +216,20 @@ def _tf_prefix(self):
)

def unquote(self) -> InputColumn:
self_copy = deepcopy(self)
self_copy = copy(self)
b = replace(self_copy.col_builder, quoted=False)
self_copy.col_builder = b
return self_copy

def quote(self) -> InputColumn:
self_copy = deepcopy(self)
self_copy = copy(self)
b = replace(self_copy.col_builder, quoted=True)
self_copy.col_builder = b
return self_copy

@property
def as_base_dialect(self) -> InputColumn:
input_column_copy = deepcopy(self)
input_column_copy = copy(self)
input_column_copy.sql_dialect = None
return input_column_copy

Expand Down

0 comments on commit 7b70d6b

Please sign in to comment.