diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index d2e1eaaa873d5..e991df4059c40 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -17,7 +17,7 @@ - name: Airtable sourceDefinitionId: 14c6e7ea-97ed-4f5e-a7b5-25e9a80b8212 dockerRepository: airbyte/source-airtable - dockerImageTag: 2.0.2 + dockerImageTag: 2.0.3 documentationUrl: https://docs.airbyte.com/integrations/sources/airtable icon: airtable.svg sourceType: api diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index 5ab5ca56bd49d..416f886afed38 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -178,7 +178,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-airtable:2.0.2" +- dockerImage: "airbyte/source-airtable:2.0.3" spec: documentationUrl: "https://docs.airbyte.com/integrations/sources/airtable" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-airtable/Dockerfile b/airbyte-integrations/connectors/source-airtable/Dockerfile index 4bbd3ecbe5c8b..f95066adc2ae9 100644 --- a/airbyte-integrations/connectors/source-airtable/Dockerfile +++ b/airbyte-integrations/connectors/source-airtable/Dockerfile @@ -34,5 +34,5 @@ COPY source_airtable ./source_airtable ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=2.0.2 +LABEL io.airbyte.version=2.0.3 LABEL io.airbyte.name=airbyte/source-airtable diff --git a/airbyte-integrations/connectors/source-airtable/source_airtable/schema_helpers.py b/airbyte-integrations/connectors/source-airtable/source_airtable/schema_helpers.py index af1f83e73f17a..8572e84824ad8 100644 --- a/airbyte-integrations/connectors/source-airtable/source_airtable/schema_helpers.py +++ b/airbyte-integrations/connectors/source-airtable/source_airtable/schema_helpers.py @@ -2,13 +2,15 @@ # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # - +import logging from copy import deepcopy from typing import Any, Dict from airbyte_cdk.models import AirbyteStream from airbyte_cdk.models.airbyte_protocol import DestinationSyncMode, SyncMode +logger: logging.Logger = logging.getLogger("airbyte") + class SchemaTypes: @@ -58,6 +60,7 @@ class SchemaTypes: "rating": SchemaTypes.number, "richText": SchemaTypes.string, "singleLineText": SchemaTypes.string, + "singleSelect": SchemaTypes.string, "externalSyncSource": SchemaTypes.string, "url": SchemaTypes.string, # referal default type @@ -103,7 +106,11 @@ def get_json_schema(table: Dict[str, Any]) -> Dict[str, str]: # Other edge cases, if `field_type` not in SIMPLE_AIRTABLE_TYPES, fall back to "simpleText" == `string` # reference issue: https://github.com/airbytehq/oncall/issues/1432#issuecomment-1412743120 if complex_type == SchemaTypes.array_with_any: - complex_type["items"] = deepcopy(SIMPLE_AIRTABLE_TYPES.get(field_type)) + if field_type in SIMPLE_AIRTABLE_TYPES: + complex_type["items"] = deepcopy(SIMPLE_AIRTABLE_TYPES.get(field_type)) + else: + complex_type["items"] = SchemaTypes.string + logger.warning(f"Unknown field type: {field_type}, falling back to `simpleText` type") properties.update(**{name: complex_type}) elif original_type in SIMPLE_AIRTABLE_TYPES.keys(): field_type: str = exec_type if exec_type else original_type diff --git a/docs/integrations/sources/airtable.md b/docs/integrations/sources/airtable.md index 57d44137d667c..9f52cfb52cbbb 100644 --- a/docs/integrations/sources/airtable.md +++ b/docs/integrations/sources/airtable.md @@ -103,6 +103,7 @@ See information about rate limits [here](https://airtable.com/developers/web/api | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:-------------------------------------------------------| +| 2.0.3 | 2023-02-02 | [22311](https://github.com/airbytehq/airbyte/pull/22311) | Fix for `singleSelect` types when discovering the schema | 2.0.2 | 2023-02-01 | [22245](https://github.com/airbytehq/airbyte/pull/22245) | Fix for empty `result` object when discovering the schema | 2.0.1 | 2023-02-01 | [22224](https://github.com/airbytehq/airbyte/pull/22224) | Fixed broken `API Key` authentication | 2.0.0 | 2023-01-27 | [21962](https://github.com/airbytehq/airbyte/pull/21962) | Added casting of native Airtable data types to JsonSchema types