[BugFix] openbb-yfinance: Remove Duplicated Line In Screener Causing Double Results For First Pass (#7022)

* remove duplicated line

* remove that other code which wasn't supposed to be there
This commit is contained in:
Danglewood
2025-02-10 12:30:28 -08:00
committed by GitHub
parent 74a01bcbf4
commit 20d12eafa6

View File

@@ -114,14 +114,13 @@ async def get_custom_screener(
results.extend(res["quotes"])
total_results = res["total"]
results.extend(res["quotes"])
while len(results) < total_results:
if limit is not None and len(results) >= limit:
break
offset = len(results)
body["offset"] = offset
res = _data.post(
response = _data.post(
"https://query2.finance.yahoo.com/v1/finance/screener",
body=body,
user_agent_headers=_data.user_agent_headers,
@@ -130,6 +129,7 @@ async def get_custom_screener(
)
if not res:
break
res = response.json()["finance"]["result"][0]
results.extend(res.get("quotes", []))
output: list = []
@@ -186,7 +186,6 @@ async def get_defined_screener(
if not response.get("quotes"):
raise EmptyDataError("No data found for the predefined screener.")
results.extend(response["quotes"])
total_results = response["total"]
results.extend(response["quotes"])