From c5cb9662d741c35ec7cc7ba61f3dd5a4e3a09bce Mon Sep 17 00:00:00 2001 From: tehcoderer Date: Tue, 28 Nov 2023 10:14:06 -0500 Subject: [PATCH] add `async` overload to `Fetcher.extract_data` --- .../core/openbb_core/provider/abstract/fetcher.py | 6 ++++++ .../providers/fmp/openbb_fmp/models/calendar_splits.py | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openbb_platform/core/openbb_core/provider/abstract/fetcher.py b/openbb_platform/core/openbb_core/provider/abstract/fetcher.py index 2a7c39e9393..c8dfd2cd932 100644 --- a/openbb_platform/core/openbb_core/provider/abstract/fetcher.py +++ b/openbb_platform/core/openbb_core/provider/abstract/fetcher.py @@ -10,6 +10,7 @@ from typing import ( TypeVar, get_args, get_origin, + overload, ) from pandas import DataFrame @@ -46,6 +47,11 @@ class Fetcher(Generic[Q, R]): """Transform the params to the provider-specific query.""" raise NotImplementedError + @overload + @staticmethod + async def extract_data(query: Q, credentials: Optional[Dict[str, str]]) -> Any: + """Extract the data from the provider.""" + @staticmethod def extract_data(query: Q, credentials: Optional[Dict[str, str]]) -> Any: """Extract the data from the provider.""" diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/calendar_splits.py b/openbb_platform/providers/fmp/openbb_fmp/models/calendar_splits.py index edf72996bfd..a5cde1bcf4f 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/calendar_splits.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/calendar_splits.py @@ -9,8 +9,7 @@ from openbb_core.provider.standard_models.calendar_splits import ( CalendarSplitsData, CalendarSplitsQueryParams, ) -from openbb_core.provider.utils.helpers import get_querystring -from openbb_fmp.utils.helpers import get_data_many +from openbb_fmp.utils.helpers import create_url, get_data_many class FMPCalendarSplitsQueryParams(CalendarSplitsQueryParams):