mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-02 23:41:27 +00:00
append return type to map
This commit is contained in:
@@ -76,3 +76,9 @@ class Fetcher(
|
||||
"""Get the type of the provider data."""
|
||||
# pylint: disable=E1101
|
||||
return self.__orig_bases__[0].__args__[3]
|
||||
|
||||
@property
|
||||
def return_type(self):
|
||||
"""Get the type of the return."""
|
||||
# pylint: disable=E1101
|
||||
return self.transform_data.__annotations__["return"]
|
||||
|
||||
@@ -57,17 +57,20 @@ class RegistryMap:
|
||||
f = fetcher()
|
||||
standard_query, extra_query = self.extract_info(f, "query_params")
|
||||
standard_data, extra_data = self.extract_info(f, "data")
|
||||
return_type = f.return_type
|
||||
|
||||
if model_name not in map_:
|
||||
map_[model_name] = {}
|
||||
map_[model_name]["openbb"] = {
|
||||
"QueryParams": standard_query,
|
||||
"Data": standard_data,
|
||||
"ReturnType": return_type,
|
||||
}
|
||||
|
||||
map_[model_name][p] = {
|
||||
"QueryParams": extra_query,
|
||||
"Data": extra_data,
|
||||
"ReturnType": return_type,
|
||||
}
|
||||
|
||||
return map_
|
||||
|
||||
Reference in New Issue
Block a user