feat(source-google-sheets): migrate connector to manifest-only (#62456)
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
43a0ce5aa1
commit
4beeba5d86
@@ -2,12 +2,30 @@
|
||||
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
|
||||
#
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from source_google_sheets.models import CellData, GridData, RowData, Sheet, SheetProperties, Spreadsheet, SpreadsheetValues, ValueRange
|
||||
|
||||
from airbyte_cdk.models.airbyte_protocol import AirbyteStream, ConfiguredAirbyteStream, DestinationSyncMode, SyncMode
|
||||
|
||||
|
||||
pytest_plugins = ["airbyte_cdk.test.utils.manifest_only_fixtures"]
|
||||
|
||||
|
||||
def _get_manifest_path() -> Path:
|
||||
source_declarative_manifest_path = Path("/airbyte/integration_code/source_declarative_manifest")
|
||||
if source_declarative_manifest_path.exists():
|
||||
return source_declarative_manifest_path
|
||||
return Path(__file__).parent.parent
|
||||
|
||||
|
||||
_SOURCE_FOLDER_PATH = _get_manifest_path()
|
||||
_YAML_FILE_PATH = _SOURCE_FOLDER_PATH / "manifest.yaml"
|
||||
|
||||
sys.path.append(str(_SOURCE_FOLDER_PATH)) # to allow loading custom components
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def invalid_config():
|
||||
return {
|
||||
@@ -21,30 +39,6 @@ def invalid_config():
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def spreadsheet():
|
||||
def maker(spreadsheet_id, sheet_name):
|
||||
return Spreadsheet(
|
||||
spreadsheetId=spreadsheet_id,
|
||||
sheets=[
|
||||
Sheet(
|
||||
data=[GridData(rowData=[RowData(values=[CellData(formattedValue="ID")])])],
|
||||
properties=SheetProperties(title=sheet_name, gridProperties={"rowCount": 2}),
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
return maker
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def spreadsheet_values():
|
||||
def maker(spreadsheet_id):
|
||||
return SpreadsheetValues(spreadsheetId=spreadsheet_id, valueRanges=[ValueRange(values=[["1"]])])
|
||||
|
||||
return maker
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def catalog():
|
||||
def maker(*name_schema_pairs):
|
||||
|
||||
Reference in New Issue
Block a user