Skip to content

Commit 3ce24c2

Browse files
dtieslingmarcosmarxm
authored andcommitted
πŸ› Source S3: fix exception when setting CSV stream delimiter to \t. (airbytehq#35246)
Co-authored-by: Marcos Marx <[email protected]> Co-authored-by: marcosmarxm <[email protected]>
1 parent 28341e2 commit 3ce24c2

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

β€Žairbyte-cdk/python/airbyte_cdk/sources/file_based/config/csv_format.py

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ class Config(OneOfOptionConfig):
150150

151151
@validator("delimiter")
152152
def validate_delimiter(cls, v: str) -> str:
153+
if v == r"\t":
154+
return v
153155
if len(v) != 1:
154156
raise ValueError("delimiter should only be one character")
155157
if v in {"\r", "\n"}:

β€Žairbyte-cdk/python/unit_tests/sources/file_based/config/test_csv_format.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import unittest
66

77
import pytest
8-
from airbyte_cdk.sources.file_based.config.csv_format import CsvHeaderAutogenerated, CsvHeaderFromCsv, CsvHeaderUserProvided
8+
from airbyte_cdk.sources.file_based.config.csv_format import CsvFormat, CsvHeaderAutogenerated, CsvHeaderFromCsv, CsvHeaderUserProvided
99
from pydantic import ValidationError
1010

1111

@@ -26,3 +26,8 @@ def test_given_autogenerated_then_csv_does_not_have_header_row(self) -> None:
2626

2727
def test_given_from_csv_then_csv_has_header_row(self) -> None:
2828
assert CsvHeaderFromCsv().has_header_row()
29+
30+
31+
class CsvDelimiterTest(unittest.TestCase):
32+
def test_tab_delimter(self):
33+
assert CsvFormat(delimiter=r"\t").delimiter == '\\t'

β€Žairbyte-integrations/connectors/source-s3/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ data:
1010
connectorSubtype: file
1111
connectorType: source
1212
definitionId: 69589781-7828-43c5-9f63-8925b1c1ccc2
13-
dockerImageTag: 4.5.5
13+
dockerImageTag: 4.5.6
1414
dockerRepository: airbyte/source-s3
1515
documentationUrl: https://docs.airbyte.com/integrations/sources/s3
1616
githubIssueLabel: source-s3

β€Žairbyte-integrations/connectors/source-s3/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
33
build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
6-
version = "4.5.5"
6+
version = "4.5.6"
77
name = "source-s3"
88
description = "Source implementation for S3."
99
authors = [ "Airbyte <[email protected]>",]

β€Ždocs/integrations/sources/s3.md

+1
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ To perform the text extraction from PDF and Docx files, the connector uses the [
264264

265265
| Version | Date | Pull Request | Subject |
266266
|:--------|:-----------|:----------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------|
267+
| 4.5.6 | 2024-02-21 | [35246](https://github.com/airbytehq/airbyte/pull/35246) | Fixes bug that occurred when creating CSV streams with tab delimiter. |
267268
| 4.5.5 | 2024-02-18 | [35392](https://github.com/airbytehq/airbyte/pull/35392) | Add support filtering by start date |
268269
| 4.5.4 | 2024-02-15 | [35055](https://github.com/airbytehq/airbyte/pull/35055) | Temporarily revert concurrency |
269270
| 4.5.3 | 2024-02-12 | [35164](https://github.com/airbytehq/airbyte/pull/35164) | Manage dependencies with Poetry. |

0 commit comments

Comments
Β (0)