1
0
mirror of synced 2025-12-25 02:09:19 -05:00

Protocol: make supported_sync_modes a required not empty list on AirbyteStream (#15591)

This commit is contained in:
Augustin
2022-10-19 15:22:25 +02:00
committed by GitHub
parent 4b0d1d4ac6
commit b564f3eb78
54 changed files with 307 additions and 153 deletions

View File

@@ -34,5 +34,5 @@ COPY google_sheets_source ./google_sheets_source
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
LABEL io.airbyte.version=0.2.20
LABEL io.airbyte.version=0.2.21
LABEL io.airbyte.name=airbyte/source-google-sheets

View File

@@ -10,7 +10,7 @@ from datetime import datetime
from typing import Dict, FrozenSet, Iterable, List
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.models.airbyte_protocol import AirbyteRecordMessage, AirbyteStream, ConfiguredAirbyteCatalog
from airbyte_cdk.models.airbyte_protocol import AirbyteRecordMessage, AirbyteStream, ConfiguredAirbyteCatalog, SyncMode
from google.oauth2 import credentials as client_account
from google.oauth2 import service_account
from googleapiclient import discovery
@@ -60,7 +60,7 @@ class Helpers(object):
"properties": {field: {"type": "string"} for field in fields},
}
return AirbyteStream(name=sheet_name, json_schema=sheet_json_schema, supported_sync_modes=["full_refresh"])
return AirbyteStream(name=sheet_name, json_schema=sheet_json_schema, supported_sync_modes=[SyncMode.full_refresh])
@staticmethod
def get_valid_headers_and_duplicates(header_row_values: List[str]) -> (List[str], List[str]):

View File

@@ -35,7 +35,7 @@ class TestHelpers(unittest.TestCase):
# For simplicity, the type of every cell is a string
"properties": {header: {"type": "string"} for header in header_values},
},
supported_sync_modes=["full_refresh"],
supported_sync_modes=[SyncMode.full_refresh],
)
actual_stream = Helpers.headers_to_airbyte_stream(logger, sheet_name, header_values)
@@ -66,7 +66,7 @@ class TestHelpers(unittest.TestCase):
# For simplicity, the type of every cell is a string
"properties": {header: {"type": "string"} for header in expected_stream_header_values},
},
supported_sync_modes=["full_refresh"],
supported_sync_modes=[SyncMode.full_refresh],
)
actual_stream = Helpers.headers_to_airbyte_stream(logger, sheet_name, header_values)
@@ -84,7 +84,7 @@ class TestHelpers(unittest.TestCase):
# For simplicity, the type of every cell is a string
"properties": {"h1": {"type": "string"}},
},
supported_sync_modes=["full_refresh"],
supported_sync_modes=[SyncMode.full_refresh],
)
actual_stream = Helpers.headers_to_airbyte_stream(logger, sheet_name, header_values)