headers function wasnt being called, just referenced

This commit is contained in:
James Maslek
2023-10-06 13:31:16 -04:00
parent 71e95a53bc
commit 39e9136cb8
3 changed files with 3 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ def get_stocks_data():
provider = random.choice(["fmp", "intrinio", "polygon", "yfinance"]) # noqa: S311
data["stocks_data"] = get_data(
"stocks", symbol=symbol, provider=provider, headers=headers
"stocks", symbol=symbol, provider=provider, headers=headers()
)
return data["stocks_data"]

View File

@@ -21,7 +21,7 @@ def get_data(menu: str, symbol: str, provider: str, headers):
"""Randomly pick a symbol and a provider and get data from the selected menu."""
url = f"http://0.0.0.0:8000/api/v1/{menu}/load?symbol={symbol}&provider={provider}"
result = requests.get(url, headers=headers, timeout=10)
result = requests.get(url, headers=headers(), timeout=10)
return result.json()["results"]

View File

@@ -21,7 +21,7 @@ def get_data(menu: str, symbol: str, provider: str, headers):
"""Randomly pick a symbol and a provider and get data from the selected menu."""
url = f"http://0.0.0.0:8000/api/v1/{menu}/load?symbol={symbol}&provider={provider}"
result = requests.get(url, headers=headers, timeout=10)
result = requests.get(url, headers=headers(), timeout=10)
return result.json()["results"]