Skip to content

Commit

Permalink
added detecting missing keys in schema context
Browse files Browse the repository at this point in the history
  • Loading branch information
godfryd committed Aug 26, 2023
1 parent 2f4f118 commit 76edd73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/kraken/server/initdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _prepare_builtin_tools():
"required": ["source"],
"properties": {
"action": {
"description": "An action that artifacts tool should execute. Default is `upload`.",
"description": "An action that artifacts tool should execute: 'download' or 'upload'. Default is `upload`.",
"type": "string",
"enum": ["download", "upload"]
},
Expand Down Expand Up @@ -426,7 +426,7 @@ def _prepare_builtin_tools():
"required": ["action"],
"properties": {
"action": {
"description": "An action that the tool should perform.",
"description": "An action that the tool should perform: 'save' or 'restore'.",
"type": "string",
"enum": ["save", "restore"]
},
Expand Down
3 changes: 2 additions & 1 deletion server/kraken/server/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class SchemaError(Exception):


class SchemaCodeContext(addict.Dict):
pass
def __missing__(self, key):
raise Exception('missing field %s' %key)


def execute_schema_code(schema_code, context=None):
Expand Down

0 comments on commit 76edd73

Please sign in to comment.