mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
[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:
@@ -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"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user