mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
[BugFix] - Explicit error message when return type is not an OBBject (#6394)
* Send an explicit message when return type isn't an OBBject * Update package_builder.py Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * lint --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
This commit is contained in:
@@ -319,6 +319,8 @@ class ImportDefinition:
|
||||
hint_type_list.append(parameter.annotation)
|
||||
|
||||
if return_type:
|
||||
if not issubclass(return_type, OBBject):
|
||||
raise ValueError("Return type must be an OBBject.")
|
||||
hint_type = get_args(get_type_hints(return_type)["results"])[0]
|
||||
hint_type_list.append(hint_type)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user