diff --git a/sources/bing_webmaster/__init__.py b/sources/bing_webmaster/__init__.py index f8e3a7201..8025e6fba 100644 --- a/sources/bing_webmaster/__init__.py +++ b/sources/bing_webmaster/__init__.py @@ -13,7 +13,7 @@ from dlt.common.typing import DictStrAny, DictStrStr from dlt.sources import DltResource -from .helpers import get_stats_with_retry, parse_response, check_api_key +from .helpers import get_stats_with_retry, parse_response @dlt.source(name="bing_webmaster") @@ -54,7 +54,6 @@ def page_stats( Yields: Iterator[Dict[str, Any]]: An iterator over list of organic traffic statistics. """ - check_api_key(api_key) api_path = "GetPageStats" for site_url in site_urls: params = {"siteUrl": site_url, "apikey": api_key} @@ -85,7 +84,6 @@ def page_query_stats( Yields: Iterator[Dict[str, Any]]: An iterator over list of organic traffic statistics. """ - check_api_key(api_key) api_path = "GetPageQueryStats" for record in site_url_pages: time.sleep(0.5) # this avoids rate limit observed after dozens of requests diff --git a/sources/bing_webmaster/helpers.py b/sources/bing_webmaster/helpers.py index 2ad26982d..f46165af4 100644 --- a/sources/bing_webmaster/helpers.py +++ b/sources/bing_webmaster/helpers.py @@ -11,14 +11,6 @@ from .settings import BASE_URL, HEADERS -def check_api_key(api_key: str) -> None: - if api_key is None or len(api_key) == 0: - raise ValueError( - """Please provide a Bing Webmaster API key in secrets.toml under - [sources.bing_webmaster] - api_key="your_api_key" """ - ) - def get_url_with_retry(url: str, params: DictStrStr) -> DictStrAny: try: