1
0
mirror of synced 2025-12-21 02:51:29 -05:00
Files
airbyte/airbyte-integrations/connectors/source-recurly/components.py
2024-12-18 14:05:43 -08:00

17 lines
503 B
Python

# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
from typing import Any, List, Mapping
import requests
from airbyte_cdk.sources.declarative.extractors.record_extractor import RecordExtractor
class ExportDatesExtractor(RecordExtractor):
def extract_records(self, response: requests.Response) -> List[Mapping[str, Any]]:
try:
dates = response.json()["dates"]
except requests.exceptions.JSONDecodeError:
dates = []
return [{"dates": dates}]