make some provider args optional

This commit is contained in:
montezdesousa
2023-08-04 10:56:20 +01:00
parent afbd4a69aa
commit 1165e57b40
5 changed files with 11 additions and 14 deletions

View File

@@ -12,4 +12,4 @@ def _rebuild_python_interface(*args, lint=True) -> None:
PackageBuilder,
)
PackageBuilder.build(modules=list(args), lint = lint)
PackageBuilder.build(modules=list(args), lint=lint)

View File

@@ -1,7 +1,6 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
from openbb_core.app.static.container import Container

View File

@@ -31,7 +31,7 @@ class PackageBuilder:
"""Build the extension package for the SDK."""
@classmethod
def build(cls, modules:Optional[List[str]]=None, lint: bool = True) -> None:
def build(cls, modules: Optional[List[str]] = None, lint: bool = True) -> None:
"""Build the extensions for the SDK."""
print("\nBuilding extensions package...\n")
cls.save_module_map()
@@ -56,7 +56,7 @@ class PackageBuilder:
)
@classmethod
def save_modules(cls, modules:Optional[List[str]] = None):
def save_modules(cls, modules: Optional[List[str]] = None):
"""Save the modules."""
print("\nWriting modules...")
route_map = PathHandler.build_route_map()

View File

@@ -50,9 +50,7 @@ class Fetcher(
) -> GenericDataType:
"""Fetch data from a provider."""
query = cls.transform_query(params=params)
data = cls.extract_data(
query=query, credentials=credentials, **kwargs
)
data = cls.extract_data(query=query, credentials=credentials, **kwargs)
results = cls.transform_data(data=data)
return results

View File

@@ -13,9 +13,9 @@ class Provider:
self,
name: str,
description: str,
website: str,
fetcher_dict: Dict[str, Type[Fetcher]],
website: Optional[str] = None,
required_credentials: Optional[List[str]] = None,
fetcher_dict: Optional[Dict[str, Type[Fetcher]]] = None,
) -> None:
"""Initialize the provider.
@@ -25,17 +25,17 @@ class Provider:
Name of the provider.
description : str
Description of the provider.
website : str
Website of the provider.
fetcher_dict : Dict[str, Type[Fetcher]]
Dictionary of fetchers.
website : Optional[str]
Website of the provider, by default None.
required_credentials : Optional[List[str]], optional
List of required credentials, by default None
fetcher_dict : Optional[Dict[str, Type[Fetcher]]]
Dictionary of fetchers, by default None.
"""
self.name = name
self.description = description
self.website = website
self.fetcher_dict = fetcher_dict
self.fetcher_dict = fetcher_dict or {}
if required_credentials is None:
self.required_credentials: List = []
else: