append return type to map

This commit is contained in:
Diogo Sousa
2023-07-29 20:23:04 +01:00
parent 7ac8938bf8
commit 3521fca6e3
2 changed files with 9 additions and 0 deletions

View File

@@ -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"]

View File

@@ -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_