fix(ingest): prevent mutable options mutation in batch/multi-example calls

Deep-copy **options in ingest_examples and batch_public_apis so that
mutable values (e.g. params dicts) are not shared across iterations.
Add rate_limit_delay to the config_only_key strip list in ingest_public_api
so it is not forwarded twice when passed via kwargs.
This commit is contained in:
KaifAhmad1
2026-06-10 15:38:30 +05:30
parent b535839003
commit fbdeb6873a
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -552,6 +552,7 @@ def ingest_public_api(
"delay",
"fail_fast",
"max_retries",
"rate_limit_delay",
"validate_no_auth",
):
request_kwargs.pop(config_only_key, None)
+2 -2
View File
@@ -565,7 +565,7 @@ class PublicAPIIngestor(RESTIngestor):
def ingest_examples(self, names: List[str], **options) -> List[APIData]:
"""Ingest multiple pre-configured public API examples."""
return [self.ingest_example(name, **options) for name in names]
return [self.ingest_example(name, **copy.deepcopy(options)) for name in names]
def batch_public_apis(
self,
@@ -578,7 +578,7 @@ class PublicAPIIngestor(RESTIngestor):
for endpoint in endpoints:
try:
results.append(
self.ingest_public_api(endpoint, method=method, **options)
self.ingest_public_api(endpoint, method=method, **copy.deepcopy(options))
)
except Exception as exc:
self.logger.warning(f"Failed to fetch public API {endpoint}: {exc}")