diff options
author | Danglewood <85772166+deeleeramone@users.noreply.github.com> | 2024-04-15 03:04:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 10:04:37 +0000 |
commit | 40ce132109871a290f0c9dd0c7674e7043853c43 (patch) | |
tree | 2b305414965903c30e4f7c004e0fd3192b3f6f27 | |
parent | b8d1846d46374d5229b74afa14333ea8468c9d74 (diff) |
[BugFix] Fixes the API (#6309)
* stops the API from breaking.
* black
* whitespace.
-rw-r--r-- | openbb_platform/core/openbb_core/app/model/metadata.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/openbb_platform/core/openbb_core/app/model/metadata.py b/openbb_platform/core/openbb_core/app/model/metadata.py index 70672dd1595..9162bfa0bea 100644 --- a/openbb_platform/core/openbb_core/app/model/metadata.py +++ b/openbb_platform/core/openbb_core/app/model/metadata.py @@ -44,7 +44,13 @@ class Metadata(BaseModel): arguments: Dict[str, Any] = {} for item in ["provider_choices", "standard_params", "extra_params"]: arguments[item] = {} - for arg, arg_val in v[item].items(): + # The item could be class or it could a dictionary. + v_item = ( + v.__dict__.get(item, {}) if not isinstance(v, dict) else v.get(item, {}) + ) + # The item might not be a dictionary yet. + v_item = v_item if isinstance(v_item, dict) else v_item.__dict__ + for arg, arg_val in v_item.items(): new_arg_val: Optional[Union[str, dict[str, Sequence[Any]]]] = None # Data |