def test_state_type_methods_with_running_state(self): state = Running() assert not state.is_pending() assert state.is_running() assert not state.is_retrying() assert not state.is_cached() assert not state.is_finished() assert not state.is_skipped() assert not state.is_scheduled() assert not state.is_successful() assert not state.is_failed() assert not state.is_mapped() assert not state.is_meta_state()
def test_reads_checkpointed_file_from_disk_if_exists(self, tmp_path): result_handler = PandasResultHandler(tmp_path / "dummy.csv", "csv") task = Task(name="Task", result_handler=result_handler) expected_result = pd.DataFrame({"one": [1, 2, 3], "two": [4, 5, 6]}) expected_result.to_csv(tmp_path / "dummy.csv", index=False) task_runner = TaskRunner(task) task_runner.upstream_states = {} old_state = Pending() new_state = Running() new_state = dsh.checkpoint_handler(task_runner, old_state, new_state) assert new_state.is_successful() pd.testing.assert_frame_equal(expected_result, new_state.result)