mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-03 07:51:49 +00:00
check creds before request
This commit is contained in:
@@ -111,7 +111,8 @@ class BenzingaGlobalNewsFetcher(
|
||||
def extract_data(
|
||||
query: BenzingaGlobalNewsQueryParams, credentials: Optional[Dict[str, str]]
|
||||
) -> List[BenzingaGlobalNewsData]:
|
||||
api_key = credentials.get("benzinga_api_key") or ""
|
||||
|
||||
api_key = credentials.get("benzinga_api_key") if credentials else ""
|
||||
|
||||
base_url = "https://api.benzinga.com/api/v2/news"
|
||||
querystring = get_querystring(query.dict(by_alias=True), [])
|
||||
|
||||
@@ -114,7 +114,8 @@ class BenzingaStockNewsFetcher(
|
||||
def extract_data(
|
||||
query: BenzingaStockNewsQueryParams, credentials: Optional[Dict[str, str]]
|
||||
) -> List[BenzingaStockNewsData]:
|
||||
api_key = credentials.get("benzinga_api_key") or ""
|
||||
|
||||
api_key = credentials.get("benzinga_api_key") if credentials else ""
|
||||
|
||||
base_url = "https://api.benzinga.com/api/v2/news"
|
||||
querystring = get_querystring(query.dict(by_alias=True), [])
|
||||
|
||||
@@ -26,8 +26,8 @@ class FREDCPIFetcher(Fetcher[CPIQueryParams, CPIData, FREDCPIQueryParams, FREDCP
|
||||
def extract_data(
|
||||
query: FREDCPIQueryParams, credentials: Optional[Dict[str, str]]
|
||||
) -> Dict[str, List[CPIData]]:
|
||||
if credentials:
|
||||
api_key = credentials.get("fred_api_key")
|
||||
|
||||
api_key = credentials.get("fred_api_key") if credentials else ""
|
||||
|
||||
all_options = all_cpi_options(query.harmonized)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user