Skip to content

Commit

Permalink
low hanging PR fruit
Browse files Browse the repository at this point in the history
  • Loading branch information
dogversioning committed Jan 9, 2024
1 parent ae004d3 commit e0b5889
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions cumulus_library/studies/core/builder_prereq_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ def prepare_queries(self, cursor: object, schema: str, *args, **kwargs):
with open(dir_path / sql_file) as file:
queries = sqlparse.split(file.read())
self.queries += queries
self.comment_queries()
self.write_queries()
exit()
2 changes: 1 addition & 1 deletion cumulus_library/studies/core/count_core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List
from pathlib import Path
import cumulus_library.statistics.counts as counts
from cumulus_library.statistics import counts


class CoreCountsBuilder(counts.CountsBuilder):
Expand Down
2 changes: 1 addition & 1 deletion cumulus_library/template_sql/statistics/count.sql.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ CREATE TABLE {{ table_name }} AS (
{%- elif fhir_resource=='encounter' and filter_resource %}
WHERE s.status = 'finished'
{%- elif fhir_resource=='observation' and filter_resource %}
WHERE (s.status = 'final' OR status= 'amended')
WHERE (s.status = 'final' OR s.status= 'amended')
{%- endif %}
),
{% endif %}
Expand Down
1 change: 0 additions & 1 deletion cumulus_library/template_sql/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ def _check_schema_if_exists(
if cursor.fetchone() is None:
return False

cursor.execute(query)
schema_str = str(cursor.fetchone()[0])
required_fields = [coding_element]
if not allow_partial:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_counts_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,4 @@
)
def test_count_query(expected, kwargs):
query = get_count_query("test_table", "test_source", ["age", "sex"], **kwargs)
with open("output.sql", "w") as f:
f.write(query)
assert query == expected

0 comments on commit e0b5889

Please sign in to comment.