-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ ModelResources can be defined with a component or a path
- Loading branch information
Showing
10 changed files
with
389 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
class ResourceAttributeError(AttributeError): | ||
ATTRIBUTE_NOT_FOUND = "needs to define attribute '{attribute}'" | ||
# RESTResource | ||
SCHEMA_NOT_FOUND = "needs to define attribute 'schema' or the pair 'input_schema' and 'output_schema'" | ||
RESOURCE_NAME_INVALID = "invalid resource name '{resource_name}'" | ||
PK_NOT_FOUND = "model must define a single-column primary key" | ||
PK_WRONG_TYPE = "model primary key wrong type" | ||
MODEL_INVALID = "model must be a valid SQLAlchemy Table instance or a Model instance" | ||
# ModelResource | ||
MODEL_NOT_FOUND = "needs to define attribute 'model_path' or 'component'" | ||
|
||
def __init__(self, msg: str, name: str): | ||
super().__init__(f"{name} {msg}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import dataclasses | ||
import re | ||
import typing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.