Skip to content

Commit

Permalink
fix: fix a python function/module name collision which broke a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
chisholm committed Oct 18, 2023
1 parent dc2e107 commit 6fe5478
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dioptra/restapi/job/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def provide_rq_service_module(
def _bind_rq_service_configuration(binder: Binder):
redis_conn: Redis = Redis.from_url(os.getenv("RQ_REDIS_URI", "redis://"))
run_mlflow: str = "dioptra.rq.tasks.run_mlflow_task"
run_task_engine: str = "dioptra.rq.tasks.run_task_engine"
run_task_engine: str = "dioptra.rq.tasks.run_task_engine_task"

configuration: RQServiceConfiguration = RQServiceConfiguration(
redis=redis_conn, run_mlflow=run_mlflow, run_task_engine=run_task_engine
Expand Down
4 changes: 2 additions & 2 deletions src/dioptra/rq/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# ACCESS THE FULL CC BY 4.0 LICENSE HERE:
# https://creativecommons.org/licenses/by/4.0/legalcode
from .run_mlflow import run_mlflow_task
from .run_task_engine import run_task_engine
from .run_task_engine import run_task_engine_task

__all__ = ["run_mlflow_task", "run_task_engine"]
__all__ = ["run_mlflow_task", "run_task_engine_task"]
2 changes: 1 addition & 1 deletion src/dioptra/rq/tasks/run_task_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _get_logger() -> Any:
return structlog.get_logger(__name__)


def run_task_engine(
def run_task_engine_task(
experiment_id: int,
experiment_desc: Mapping[str, Any],
global_parameters: MutableMapping[str, Any],
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/rq/tasks/test_run_task_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def dioptra_set_run_id_for_job(self, run_id, job_id):
{"Bucket": "plugins", "Key": "dioptra_custom/file4.dat"},
)

dioptra.rq.tasks.run_task_engine.run_task_engine(
dioptra.rq.tasks.run_task_engine.run_task_engine_task(
1, silly_experiment, global_experiment_params, s3
)

Expand Down

0 comments on commit 6fe5478

Please sign in to comment.