Skip to content

Commit

Permalink
Bump & Publish Google sheets connector (#2994)
Browse files Browse the repository at this point in the history
  • Loading branch information
sherifnada committed Apr 20, 2021
1 parent 33c20b8 commit 643a2fc
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sourceDefinitionId": "29b409d9-30a5-4cc8-ad50-886eb846fea3",
"name": "Qucikbooks",
"name": "Quickbooks",
"dockerRepository": "airbyte/source-quickbooks-singer",
"dockerImageTag": "0.1.0",
"documentationUrl": "https://hub.docker.com/r/airbyte/source-quickbooks-singer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"sourceDefinitionId": "71607ba1-c0ac-4799-8049-7f4b90dd50f7",
"name": "Google Sheets",
"dockerRepository": "airbyte/source-google-sheets",
"dockerImageTag": "0.2.1",
"dockerImageTag": "0.2.2",
"documentationUrl": "https://hub.docker.com/repository/docker/airbyte/source-google-sheets"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sourceDefinitionId": "b39a7370-74c3-45a6-ac3a-380d48520a83",
"name": "Oracle",
"name": "Oracle DB",
"dockerRepository": "airbyte/source-oracle",
"dockerImageTag": "0.2.0",
"documentationUrl": "https://hub.docker.com/r/airbyte/source-oracle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
- sourceDefinitionId: 71607ba1-c0ac-4799-8049-7f4b90dd50f7
name: Google Sheets
dockerRepository: airbyte/source-google-sheets
dockerImageTag: 0.2.1
dockerImageTag: 0.2.2
documentationUrl: https://hub.docker.com/repository/docker/airbyte/source-google-sheets
- sourceDefinitionId: 435bb9a5-7887-4809-aa58-28c27df0d7ad
name: MySQL
Expand Down Expand Up @@ -210,7 +210,7 @@
# dockerImageTag: 0.1.1
# documentationUrl: https://hub.docker.com/r/airbyte/source-smartsheets
- sourceDefinitionId: b39a7370-74c3-45a6-ac3a-380d48520a83
name: Oracle
name: Oracle DB
dockerRepository: airbyte/source-oracle
dockerImageTag: 0.2.0
documentationUrl: https://hub.docker.com/r/airbyte/source-oracle
Expand All @@ -220,7 +220,7 @@
dockerImageTag: 0.1.0
documentationUrl: https://hub.docker.com/r/airbyte/source-zendesk-talk
- sourceDefinitionId: 29b409d9-30a5-4cc8-ad50-886eb846fea3
name: Qucikbooks
name: Quickbooks
dockerRepository: airbyte/source-quickbooks-singer
dockerImageTag: 0.1.0
documentationUrl: https://hub.docker.com/r/airbyte/source-quickbooks-singer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ COPY $CODE_PATH ./$CODE_PATH
COPY setup.py ./
RUN pip install .

LABEL io.airbyte.version=0.2.1
LABEL io.airbyte.version=0.2.2
LABEL io.airbyte.name=airbyte/source-google-sheets
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,19 @@ def check(self, logger: AirbyteLogger, config: json) -> AirbyteConnectionStatus:
except Exception as err:
logger.error(str(err))
return AirbyteConnectionStatus(
status=Status.FAILED,
message=f"Unable to read the schema of sheet {sheet_name}. Error: {str(err)}"
status=Status.FAILED, message=f"Unable to read the schema of sheet {sheet_name}. Error: {str(err)}"
)
if duplicate_headers_in_sheet:
duplicate_headers_error_message = ", ".join([f"[sheet:{sheet_name}, headers:{duplicate_sheet_headers}]"
for sheet_name,duplicate_sheet_headers in duplicate_headers_in_sheet.items()])
duplicate_headers_error_message = ", ".join(
[
f"[sheet:{sheet_name}, headers:{duplicate_sheet_headers}]"
for sheet_name, duplicate_sheet_headers in duplicate_headers_in_sheet.items()
]
)
return AirbyteConnectionStatus(
status=Status.FAILED,
message="The following duplicate headers were found in the following sheets. Please fix them to continue: "
+ duplicate_headers_error_message
+ duplicate_headers_error_message,
)

return AirbyteConnectionStatus(status=Status.SUCCEEDED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
from datetime import datetime
from typing import Dict, FrozenSet, Iterable, List

from base_python import AirbyteLogger
from airbyte_protocol import AirbyteRecordMessage, AirbyteStream, ConfiguredAirbyteCatalog
from base_python import AirbyteLogger
from google.oauth2 import service_account
from googleapiclient import discovery

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import sys

from base_python.entrypoint import launch

from google_sheets_source import GoogleSheetsSource

if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"streams": [
{
"stream" : {
"stream": {
"name": "Sheet1",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"ID": {
"type": "string"
},
"Name": {
"type": "string"
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"ID": {
"type": "string"
},
"Name": {
"type": "string"
}
}
}
},
},
"supported_sync_modes": ["full_refresh"],
"source_defined_cursor": false
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"spreadsheet_id" : "randomid",
"credentials_json" : "{\"type\": \"service_account\",\"project_id\": \"airbyte-310409\",\"private_key_id\": \"xyz\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\n ... -----END PRIVATE KEY-----\\n\",\"client_email\": \"airbyte@airbyte-123456.iam.gserviceaccount.com\",\"client_id\": \"121512124\",\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/airbyte%40airbyte-123456.iam.gserviceaccount.com\"}"
"spreadsheet_id": "randomid",
"credentials_json": "{\"type\": \"service_account\",\"project_id\": \"airbyte-310409\",\"private_key_id\": \"xyz\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\n ... -----END PRIVATE KEY-----\\n\",\"client_email\": \"airbyte@airbyte-123456.iam.gserviceaccount.com\",\"client_id\": \"121512124\",\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/airbyte%40airbyte-123456.iam.gserviceaccount.com\"}"
}


Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@
import unittest
from unittest.mock import Mock, patch

from base_python import AirbyteLogger
from airbyte_protocol import AirbyteRecordMessage, AirbyteStream, ConfiguredAirbyteCatalog, ConfiguredAirbyteStream, SyncMode
from airbyte_protocol.models.airbyte_protocol import DestinationSyncMode
from base_python import AirbyteLogger
from google_sheets_source.client import GoogleSheetsClient
from google_sheets_source.helpers import Helpers
from google_sheets_source.models import CellData, GridData, RowData, Sheet, SheetProperties, Spreadsheet

logger = AirbyteLogger()


class TestHelpers(unittest.TestCase):
def test_headers_to_airbyte_stream(self):
sheet_name = "sheet1"
Expand Down

0 comments on commit 643a2fc

Please sign in to comment.