Skip to content

Commit

Permalink
Add specs and instances (#14)
Browse files Browse the repository at this point in the history
* add specs

* add specs

* add taskspec

* taskspec

* taskspec

* update

* add specs

* update tests

* fix get_origin_type

* update

* update

* update

* update

* update

* update

* improve instances

* update

* rename

* update

* refactor spec

* improve

* task context

* add

* execution
  • Loading branch information
goodwanghan committed Apr 27, 2020
1 parent 4cb9fba commit 483b9ac
Show file tree
Hide file tree
Showing 14 changed files with 2,428 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.8]
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
Expand Down
47 changes: 47 additions & 0 deletions adagio/exceptions.py
@@ -0,0 +1,47 @@
from typing import Iterable


class AdagioError(Exception):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)


class WorkflowBug(AdagioError):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)


class CompileError(AdagioError):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)


class DependencyDefinitionError(CompileError):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)


class DependencyNotDefinedError(DependencyDefinitionError):
def __init__(self, name: str, expected: Iterable[str], actual: Iterable[str]):
s = f"expected {sorted(expected)}, actual {sorted(actual)}"
super().__init__(f"Task {name} dependencies not well defined: " + s)


class WorkflowRuntimeError(AdagioError):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)


class AbortedError(WorkflowRuntimeError):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)


class SkippedError(WorkflowRuntimeError):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)


def assert_on_compile(bool_expr: bool, msg: str) -> None:
if not bool_expr:
raise CompileError(msg)

0 comments on commit 483b9ac

Please sign in to comment.