Skip to content

Commit ef9c1dd

Browse files
feat: add flexible pattern and multiple examples for start_date field
Co-Authored-By: AJ Steers <aj@airbyte.io>
1 parent 8526249 commit ef9c1dd

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

airbyte_cdk/sources/file_based/config/abstract_file_based_spec.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,15 @@ class AbstractFileBasedSpec(BaseModel):
5454
start_date: Optional[str] = Field(
5555
title="Start Date",
5656
description="UTC date and time in the format 2017-01-25T00:00:00.000000Z. Any file modified before this date will not be replicated.",
57-
examples=["2021-01-01T00:00:00.000000Z"],
57+
examples=[
58+
"2021-01-01T00:00:00.000000Z",
59+
"2021-01-01T00:00:00Z",
60+
"2021-01-01T00:00:00.000Z",
61+
"2021-01-01",
62+
],
5863
format="date-time",
64+
pattern=r"^[0-9]{4}-[0-9]{2}-[0-9]{2}(T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})?)?$",
65+
pattern_descriptor="YYYY-MM-DD, YYYY-MM-DDTHH:mm:ssZ, or YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
5966
order=1,
6067
)
6168

unit_tests/sources/file_based/scenarios/csv_scenarios.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,15 @@
6161
"start_date": {
6262
"title": "Start Date",
6363
"description": "UTC date and time in the format 2017-01-25T00:00:00.000000Z. Any file modified before this date will not be replicated.",
64-
"examples": ["2021-01-01T00:00:00.000000Z"],
64+
"examples": [
65+
"2021-01-01T00:00:00.000000Z",
66+
"2021-01-01T00:00:00Z",
67+
"2021-01-01T00:00:00.000Z",
68+
"2021-01-01",
69+
],
6570
"format": "date-time",
71+
"pattern": r"^[0-9]{4}-[0-9]{2}-[0-9]{2}(T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})?)?$",
72+
"pattern_descriptor": "YYYY-MM-DD, YYYY-MM-DDTHH:mm:ssZ, or YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
6673
"order": 1,
6774
"type": "string",
6875
},

0 commit comments

Comments
 (0)