Skip to content

Commit

Permalink
Changes related to ditching Dagster (#204)
Browse files Browse the repository at this point in the history
- Use ExecutionDirection enum instead of strings

Re spine-tools/Spine-Toolbox#2523
  • Loading branch information
ptsavol authored Apr 25, 2024
1 parent 1ea1f1f commit 18d8a92
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-e git+https://github.com/spine-tools/[email protected]#egg=spinedb_api
-e git+https://github.com/spine-tools/spine-engine.git@0.8-dev#egg=spine_engine
-e git+https://github.com/spine-tools/Spine-Toolbox.git@0.8-dev#egg=spinetoolbox
-e git+https://github.com/spine-tools/spine-engine.git@jumpster#egg=spine_engine
-e git+https://github.com/spine-tools/Spine-Toolbox.git@issue_2523#egg=spinetoolbox
-e .
3 changes: 2 additions & 1 deletion spine_items/db_writer_item_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

"""Contains base classes for items that write to db."""
from PySide6.QtCore import Slot
from spine_engine.utils.helpers import ExecutionDirection
from spinetoolbox.project_item.project_item import ProjectItem


Expand All @@ -27,7 +28,7 @@ def successor_data_stores(self):
@Slot(object, object)
def handle_execution_successful(self, execution_direction, engine_state):
"""Notifies Toolbox of successful database import."""
if execution_direction != "FORWARD":
if execution_direction != ExecutionDirection.FORWARD:
return
committed_db_maps = set()
for successor in self.successor_data_stores():
Expand Down
4 changes: 2 additions & 2 deletions spine_items/exporter/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
from operator import itemgetter
from pathlib import Path
from PySide6.QtCore import Slot, Qt

from spinetoolbox.helpers import SealCommand
from spinetoolbox.project_item.project_item import ProjectItem
from spine_engine.utils.serialization import deserialize_path
from spine_engine.utils.helpers import ExecutionDirection
from spinedb_api import clear_filter_configs
from .export_manifest import exported_files_as_resources
from .specification import OutputFormat
Expand Down Expand Up @@ -112,7 +112,7 @@ def has_out_url(self):

def handle_execution_successful(self, execution_direction, engine_state):
"""See base class."""
if execution_direction != "FORWARD":
if execution_direction != ExecutionDirection.FORWARD:
return
self._resources_to_successors_changed()

Expand Down
4 changes: 2 additions & 2 deletions spine_items/tool/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from spinetoolbox.mvcmodels.file_list_models import FileListModel
from spine_engine.config import TOOL_OUTPUT_DIR
from spine_engine.project_item.project_item_resource import CmdLineArg, make_cmd_line_arg, LabelArg
from spine_engine.utils.helpers import resolve_python_interpreter, resolve_julia_executable
from spine_engine.utils.helpers import resolve_python_interpreter, resolve_julia_executable, ExecutionDirection
from .commands import (
UpdateKillCompletedProcesses,
UpdateToolExecuteInWorkCommand,
Expand Down Expand Up @@ -503,7 +503,7 @@ def _check_notifications(self):
def handle_execution_successful(self, execution_direction, engine_state):
"""See base class."""
super().handle_execution_successful(execution_direction, engine_state)
if execution_direction != "FORWARD":
if execution_direction != ExecutionDirection.FORWARD:
return
self._resources_to_successors_changed()

Expand Down
5 changes: 2 additions & 3 deletions tests/data_store/test_dataStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
create_toolboxui_with_project,
)


class TestDataStore(unittest.TestCase):
def test_item_type(self):
"""Tests that the item type is correct."""
Expand Down Expand Up @@ -140,9 +141,7 @@ def test_dirty_db_notification(self):
# Check that the warning disappears after committing the changes
self._toolbox.db_mngr.commit_session("Added entity classes", db_map)
self.ds._check_notifications()
self.assertEqual(
[], self.ds.get_icon().exclamation_icon._notifications
)
self.assertEqual([], self.ds.get_icon().exclamation_icon._notifications)


# noinspection PyUnusedLocal
Expand Down

0 comments on commit 18d8a92

Please sign in to comment.