Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source GCS: Fix unstructured format #34158

Merged
merged 6 commits into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -58,9 +58,9 @@
},
"primary_key": {
"title": "Primary Key",
"description": "The column or columns (for a composite key) that serves as the unique identifier of a record.",
"type": "string",
"airbyte_hidden": true
"description": "The column or columns (for a composite key) that serves as the unique identifier of a record. If empty, the primary key will default to the parser's default primary key.",
"airbyte_hidden": true,
"type": "string"
},
"days_to_sync_if_history_is_full": {
"title": "Days To Sync If History Is Full",
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-gcs/metadata.yaml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ data:
connectorSubtype: file
connectorType: source
definitionId: 2a8c41ae-8c23-4be0-a73f-2ab10ca1a820
dockerImageTag: 0.3.3
dockerImageTag: 0.3.4
dockerRepository: airbyte/source-gcs
documentationUrl: https://docs.airbyte.com/integrations/sources/gcs
githubIssueLabel: source-gcs
Original file line number Diff line number Diff line change
@@ -80,3 +80,7 @@ def replace_enum_allOf_and_anyOf(schema):
objects_to_check["anyOf"] = objects_to_check.pop("allOf")

return super(Config, Config).replace_enum_allOf_and_anyOf(schema)

@staticmethod
def remove_discriminator(schema) -> None:
pass
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
import itertools
import json
import logging
from contextlib import contextmanager
from datetime import datetime, timedelta
from io import IOBase
from typing import Iterable, List, Optional
@@ -94,7 +93,6 @@ def _handle_file_listing_error(self, exc: Exception, prefix: str, logger: loggin
prefix=prefix,
) from exc

@contextmanager
def open_file(self, file: RemoteFile, mode: FileReadMode, encoding: Optional[str], logger: logging.Logger) -> IOBase:
"""
Open and yield a remote file from GCS for reading.
@@ -105,7 +103,4 @@ def open_file(self, file: RemoteFile, mode: FileReadMode, encoding: Optional[str
except OSError as oe:
logger.warning(ERROR_MESSAGE_ACCESS.format(uri=file.uri, bucket=self.config.bucket))
logger.exception(oe)
try:
yield result
finally:
result.close()
return result
1 change: 1 addition & 0 deletions docs/integrations/sources/gcs.md
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ Use the service account ID from above, grant read access to your target bucket.

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:----------------------------------------------------|
| 0.3.4 | 2024-01-11 | [34158](https://github.com/airbytehq/airbyte/pull/34158) | Fix issue in stream reader for document file type parser |
| 0.3.3 | 2023-12-06 | [33187](https://github.com/airbytehq/airbyte/pull/33187) | Bump CDK version to hide source-defined primary key |
| 0.3.2 | 2023-11-16 | [32608](https://github.com/airbytehq/airbyte/pull/32608) | Improve document file type parser |
| 0.3.1 | 2023-11-13 | [32357](https://github.com/airbytehq/airbyte/pull/32357) | Improve spec schema |
Loading