Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dogversioning committed Jan 21, 2025
1 parent 91654e7 commit 9d1273a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
13 changes: 12 additions & 1 deletion cumulus_library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
from cumulus_library.builders.base_table_builder import BaseTableBuilder
from cumulus_library.builders.counts import CountsBuilder
from cumulus_library.study_manifest import StudyManifest
from cumulus_library.template_sql.base_templates import get_template

__all__ = ["BaseTableBuilder", "CountsBuilder", "StudyConfig", "StudyManifest"]
# A note about the `get_template` function:
# As of this writing, the get_template function is used internally by the
# Cumulus team across multiple study repos for creating SQL in databases, both
# from the templates in this repo and in the various other projects (while leveraging
# some of our syntax helper macros, which are auto loaded by this function).
# Breaking changes to these templates will result in a major version bump.

# This API should be usable for your own study efforts - but the documentation
# is all code level. See template_sql for more information.

__all__ = ["BaseTableBuilder", "CountsBuilder", "StudyConfig", "StudyManifest", "get_template"]
__version__ = "4.2.0"
2 changes: 2 additions & 0 deletions cumulus_library/template_sql/base_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class TableView(enum.Enum):

def get_base_template(*args, **kwargs):
"""Legacy wrapper for get_template"""
# TODO: Isolate this as sole library entrypoint after cutting over studies to use
# the public get_template
return get_template(*args, **kwargs)


Expand Down
3 changes: 0 additions & 3 deletions tests/test_data/study_python_counts_valid/module1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
class ModuleOneRunner(cumulus_library.CountsBuilder):
display_text = "module1"

def __init__(self, *args, **kwargs):
super().__init__(study_prefix="study_python_counts_valid")

def prepare_queries(self, *args, **kwargs):
self.queries.append(
"CREATE TABLE IF NOT EXISTS study_python_counts_valid__table1 (test int);"
Expand Down
3 changes: 0 additions & 3 deletions tests/test_data/study_python_counts_valid/module2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
class ModuleTwoRunner(cumulus_library.CountsBuilder):
display_text = "module2"

def __init__(self, *args, **kwargs):
super().__init__(study_prefix="study_python_counts_valid")

def prepare_queries(self, *args, **kwargs):
self.queries.append(
"CREATE TABLE IF NOT EXISTS study_python_counts_valid__table2 (test int);"
Expand Down

0 comments on commit 9d1273a

Please sign in to comment.