Fix for options that can have multiple values other than strings#387
Conversation
| except Exception as e: | ||
| logger.warning(f"Adapter {type(adapter).__name__} failed: {e}") | ||
| raise ValueError(f"Adapter {type(adapter).__name__} failed: {e}") | ||
|
|
There was a problem hiding this comment.
Raising an exception here displays the actual error in the UI
There was a problem hiding this comment.
In the future we'll probably want to capture all these parse errors (and also the the JSON parse exceptions on line 257) and present them to the user, but keep processing, so that one bad manifest doesn't break the entire repo. But I think this is reasonable for now.
| required: bool = Field(description="Whether the parameter is required", default=False) | ||
| default: Optional[Any] = Field(description="Default value for the parameter", default=None) | ||
| options: Optional[List[str]] = Field(description="Allowed values for enum type", default=None) | ||
| options: Optional[List[Any]] = Field(description="Allowed values for enum type", default=None) |
There was a problem hiding this comment.
Is Any too broad here? Can it be narrowed down?
There was a problem hiding this comment.
it can - so far I only use str|int but I can see somebody may use float so we can make it List[str|int|float]
| except Exception as e: | ||
| logger.warning(f"Adapter {type(adapter).__name__} failed: {e}") | ||
| raise ValueError(f"Adapter {type(adapter).__name__} failed: {e}") | ||
|
|
There was a problem hiding this comment.
In the future we'll probably want to capture all these parse errors (and also the the JSON parse exceptions on line 257) and present them to the user, but keep processing, so that one bad manifest doesn't break the entire repo. But I think this is reasonable for now.
allison-truhlar
left a comment
There was a problem hiding this comment.
Works for me, thanks Cristian!
This is the fix for #386. The problem was not related to the branch as the ticket mentioned but the schema optional values. The branch failed because of this particular parameter which was only in the branch and not in main: