generated from MITLibraries/python-cli-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from MITLibraries/HRQB-18-connection-tests
Update main from HRQB-17 and HRQB-18
- Loading branch information
Showing
8 changed files
with
251 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,3 @@ | ||
"""hrqb.tasks.pipelines""" | ||
|
||
import luigi # type: ignore[import-untyped] | ||
from luigi.execution_summary import LuigiRunResult # type: ignore[import-untyped] | ||
|
||
from hrqb.config import Config | ||
|
||
|
||
def run_pipeline(pipeline_task: luigi.WrapperTask) -> LuigiRunResult: | ||
"""Function to run a HRQBPipelineTask via luigi runner.""" | ||
return luigi.build( | ||
[pipeline_task], | ||
local_scheduler=True, | ||
detailed_summary=True, | ||
workers=Config().LUIGI_NUM_WORKERS or 1, | ||
) | ||
# WIP: HRQBPipelineTasks will be defined here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""hrqb.utils.luigi""" | ||
|
||
import luigi # type: ignore[import-untyped] | ||
from luigi.execution_summary import LuigiRunResult # type: ignore[import-untyped] | ||
|
||
from hrqb.base.task import HRQBPipelineTask | ||
from hrqb.config import Config | ||
|
||
|
||
def run_task(task: luigi.Task) -> LuigiRunResult: | ||
"""Function to run any luigi Task type via luigi runner.""" | ||
return luigi.build( | ||
[task], | ||
local_scheduler=True, | ||
detailed_summary=True, | ||
workers=Config().LUIGI_NUM_WORKERS or 1, | ||
) | ||
|
||
|
||
def run_pipeline(pipeline_task: luigi.WrapperTask) -> LuigiRunResult: | ||
"""Function to run a HRQBPipelineTask.""" | ||
if not isinstance(pipeline_task, HRQBPipelineTask): | ||
message = ( | ||
f"{pipeline_task.__class__.__name__} is not a HRQBPipelineTask type task" | ||
) | ||
raise TypeError(message) | ||
return run_task(pipeline_task) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.