Skip to content

Commit

Permalink
sqlfluff cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dogversioning committed Dec 26, 2023
1 parent 28e8a80 commit 335be15
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cumulus_library/template_sql/alias_table.sql.jinja
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CREATE OR REPLACE VIEW {{ target }}
AS SELECT * FROM {{ source }};
CREATE OR REPLACE VIEW {{ target_table }}
AS SELECT * FROM {{ source_table }};
2 changes: 1 addition & 1 deletion cumulus_library/template_sql/select_all.sql.jinja
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SELECT * FROM {{ target }};
SELECT * FROM {{ source_table }};
10 changes: 6 additions & 4 deletions cumulus_library/template_sql/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ def __init__(
self.is_array = is_array


def get_alias_table_query(source: str, target: str):
def get_alias_table_query(source_table: str, target_table: str):
"""Creates a 1-1 alias of a given table"""
with open(f"{PATH}/alias_table.sql.jinja") as alias_table:
return Template(alias_table.read()).render(source=source, target=target)
return Template(alias_table.read()).render(
source_table=source, target_table=target
)


def get_code_system_pairs(output_table_name: str, code_system_tables: list) -> str:
Expand Down Expand Up @@ -305,9 +307,9 @@ def get_is_table_not_empty_query(
)


def get_select_all_query(target: str):
def get_select_all_query(source_table: str):
with open(f"{PATH}/select_all.sql.jinja") as select_all:
return Template(select_all.read()).render(target=target)
return Template(select_all.read()).render(source_table=source_table)


def get_show_tables(schema_name: str, prefix: str) -> str:
Expand Down

0 comments on commit 335be15

Please sign in to comment.