summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Radovanovic <74266147+IgorWounds@users.noreply.github.com>2024-05-13 20:34:55 +0200
committerGitHub <noreply@github.com>2024-05-13 18:34:55 +0000
commit10dddfd893680d5aa230ffab7ff6b0ed1c8f3f8b (patch)
tree1970126d13844918bdd39bb25179716fac43260c
parent4ed5f054caa0ce1f60f8fde2ebdbfc6479df4c04 (diff)
[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>
-rw-r--r--openbb_platform/core/openbb_core/app/static/package_builder.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/openbb_platform/core/openbb_core/app/static/package_builder.py b/openbb_platform/core/openbb_core/app/static/package_builder.py
index 5db17483a19..11fcc5766b0 100644
--- a/openbb_platform/core/openbb_core/app/static/package_builder.py
+++ b/openbb_platform/core/openbb_core/app/static/package_builder.py
@@ -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)