Skip to content

Commit

Permalink
Remove old method
Browse files Browse the repository at this point in the history
  • Loading branch information
ccharlesgb committed Jan 10, 2024
1 parent de58fb7 commit f4629e1
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions dbt_dry_run/literals.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import re
from typing import Callable, Dict, List, Optional, cast
from typing import Callable, Dict, List, Optional
from uuid import uuid4

import sqlglot
Expand Down Expand Up @@ -85,17 +84,6 @@ def get_sql_literal_from_table(table: Table) -> str:
return select_literal


def replace_upstream_sql_old(node_sql: str, node: Node, table: Table) -> str:
upstream_table_ref = node.to_table_ref_literal()
regex = re.compile(
rf"((?:from|join)(?:\s--.*)?[\r\n\s]*)({upstream_table_ref})",
flags=re.IGNORECASE | re.MULTILINE,
)
select_literal = get_sql_literal_from_table(table)
new_node_sql = regex.sub(r"\1" + select_literal, node_sql)
return new_node_sql


def convert_trees_to_sql(trees: List[sqlglot.Expression]) -> str:
return ";\n".join(tree.sql(sqlglot.dialects.BigQuery) for tree in trees)

Expand Down

0 comments on commit f4629e1

Please sign in to comment.