Skip to content

Commit c44f083

Browse files
committed
update models
1 parent a7054e5 commit c44f083

File tree

1 file changed

+35
-14
lines changed

1 file changed

+35
-14
lines changed

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,12 @@ class MinMaxDatetime(BaseModel):
983983
datetime: str = Field(
984984
...,
985985
description="Datetime value.",
986-
examples=["2021-01-01", "2021-01-01T00:00:00Z", "{{ config['start_time'] }}"],
986+
examples=[
987+
"2021-01-01",
988+
"2021-01-01T00:00:00Z",
989+
"{{ config['start_time'] }}",
990+
"{{ now_utc().strftime('%Y-%m-%dT%H:%M:%SZ') }}",
991+
],
987992
title="Datetime",
988993
)
989994
datetime_format: Optional[str] = Field(
@@ -1797,7 +1802,19 @@ class DatetimeBasedCursor(BaseModel):
17971802
)
17981803
cursor_datetime_formats: Optional[List[str]] = Field(
17991804
None,
1800-
description="The possible formats for the cursor field, in order of preference. The first format that matches the cursor field value will be used to parse it. If not provided, the `datetime_format` will be used.",
1805+
description="The possible formats for the cursor field, in order of preference. The first format that matches the cursor field value will be used to parse it. If not provided, the Outgoing Datetime Format will be used.\n\nUse placeholders starting with \"%\" to describe the format the API is using. The following placeholders are available:\n * **%s**: Epoch unix timestamp - `1686218963`\n * **%s_as_float**: Epoch unix timestamp in seconds as float with microsecond precision - `1686218963.123456`\n * **%ms**: Epoch unix timestamp - `1686218963123`\n * **%a**: Weekday (abbreviated) - `Sun`\n * **%A**: Weekday (full) - `Sunday`\n * **%w**: Weekday (decimal) - `0` (Sunday), `6` (Saturday)\n * **%d**: Day of the month (zero-padded) - `01`, `02`, ..., `31`\n * **%b**: Month (abbreviated) - `Jan`\n * **%B**: Month (full) - `January`\n * **%m**: Month (zero-padded) - `01`, `02`, ..., `12`\n * **%y**: Year (without century, zero-padded) - `00`, `01`, ..., `99`\n * **%Y**: Year (with century) - `0001`, `0002`, ..., `9999`\n * **%H**: Hour (24-hour, zero-padded) - `00`, `01`, ..., `23`\n * **%I**: Hour (12-hour, zero-padded) - `01`, `02`, ..., `12`\n * **%p**: AM/PM indicator\n * **%M**: Minute (zero-padded) - `00`, `01`, ..., `59`\n * **%S**: Second (zero-padded) - `00`, `01`, ..., `59`\n * **%f**: Microsecond (zero-padded to 6 digits) - `000000`, `000001`, ..., `999999`\n * **%_ms**: Millisecond (zero-padded to 3 digits) - `000`, `001`, ..., `999`\n * **%z**: UTC offset - `(empty)`, `+0000`, `-04:00`\n * **%Z**: Time zone name - `(empty)`, `UTC`, `GMT`\n * **%j**: Day of the year (zero-padded) - `001`, `002`, ..., `366`\n * **%U**: Week number of the year (Sunday as first day) - `00`, `01`, ..., `53`\n * **%W**: Week number of the year (Monday as first day) - `00`, `01`, ..., `53`\n * **%c**: Date and time representation - `Tue Aug 16 21:30:00 1988`\n * **%x**: Date representation - `08/16/1988`\n * **%X**: Time representation - `21:30:00`\n * **%%**: Literal '%' character\n\n Some placeholders depend on the locale of the underlying system - in most cases this locale is configured as en/US. For more information see the [Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).\n",
1806+
examples=[
1807+
"%Y-%m-%d",
1808+
"%Y-%m-%d %H:%M:%S",
1809+
"%Y-%m-%dT%H:%M:%S",
1810+
"%Y-%m-%dT%H:%M:%SZ",
1811+
"%Y-%m-%dT%H:%M:%S%z",
1812+
"%Y-%m-%dT%H:%M:%S.%fZ",
1813+
"%Y-%m-%dT%H:%M:%S.%f%z",
1814+
"%Y-%m-%d %H:%M:%S.%f+00:00",
1815+
"%s",
1816+
"%ms",
1817+
],
18011818
title="Cursor Datetime Formats",
18021819
)
18031820
start_datetime: Union[MinMaxDatetime, str] = Field(
@@ -1812,7 +1829,11 @@ class DatetimeBasedCursor(BaseModel):
18121829
title="Inject Start Time Into Outgoing HTTP Request",
18131830
)
18141831
end_datetime: Optional[Union[MinMaxDatetime, str]] = Field(
1815-
None,
1832+
{
1833+
"type": "MinMaxDatetime",
1834+
"datetime": "{{ now_utc().strftime('%Y-%m-%dT%H:%M:%SZ') }}",
1835+
"datetime_format": "%Y-%m-%dT%H:%M:%SZ",
1836+
},
18161837
description="The datetime that determines the last record that should be synced. If not provided, `{{ now_utc() }}` will be used.",
18171838
examples=["2021-01-1T00:00:00Z", "{{ now_utc() }}", "{{ day_delta(-1) }}"],
18181839
title="End Datetime",
@@ -1830,33 +1851,33 @@ class DatetimeBasedCursor(BaseModel):
18301851
)
18311852
cursor_granularity: Optional[str] = Field(
18321853
None,
1833-
description="Smallest increment the datetime_format has (ISO 8601 duration) that is used to ensure the start of a slice does not overlap with the end of the previous one, e.g. for %Y-%m-%d the granularity should be P1D, for %Y-%m-%dT%H:%M:%SZ the granularity should be PT1S. Given this field is provided, `step` needs to be provided as well.",
1854+
description="Smallest increment the datetime_format has (ISO 8601 duration) that is used to ensure the start of a slice does not overlap with the end of the previous one, e.g. for %Y-%m-%d the granularity should\nbe P1D, for %Y-%m-%dT%H:%M:%SZ the granularity should be PT1S. Given this field is provided, `step` needs to be provided as well.\n * **PT0.000001S**: 1 microsecond\n * **PT0.001S**: 1 millisecond\n * **PT1S**: 1 second\n * **PT1M**: 1 minute\n * **PT1H**: 1 hour\n * **P1D**: 1 day\n",
18341855
examples=["PT1S"],
18351856
title="Cursor Granularity",
18361857
)
18371858
is_data_feed: Optional[bool] = Field(
18381859
None,
18391860
description="A data feed API is an API that does not allow filtering and paginates the content from the most recent to the least recent. Given this, the CDK needs to know when to stop paginating and this field will generate a stop condition for pagination.",
1840-
title="Whether the target API is formatted as a data feed",
1861+
title="Data Feed API",
18411862
)
18421863
is_client_side_incremental: Optional[bool] = Field(
18431864
None,
1844-
description="If the target API endpoint does not take cursor values to filter records and returns all records anyway, the connector with this cursor will filter out records locally, and only emit new records from the last sync, hence incremental. This means that all records would be read from the API, but only new records will be emitted to the destination.",
1845-
title="Whether the target API does not support filtering and returns all data (the cursor filters records in the client instead of the API side)",
1865+
description="Set to True if the target API endpoint does not take cursor values to filter records and returns all records anyway. This will cause the connector to filter out records locally, and only emit new records from the last sync, hence incremental. This means that all records would be read from the API, but only new records will be emitted to the destination.",
1866+
title="Client-side Incremental Filtering",
18461867
)
18471868
is_compare_strictly: Optional[bool] = Field(
18481869
False,
1849-
description="Set to True if the target API does not accept queries where the start time equal the end time.",
1850-
title="Whether to skip requests if the start time equals the end time",
1870+
description="Set to True if the target API does not accept queries where the start time equal the end time. This will cause those requests to be skipped.",
1871+
title="Strict Start-End Time Comparison",
18511872
)
18521873
global_substream_cursor: Optional[bool] = Field(
18531874
False,
1854-
description="This setting optimizes performance when the parent stream has thousands of partitions by storing the cursor as a single value rather than per partition. Notably, the substream state is updated only at the end of the sync, which helps prevent data loss in case of a sync failure. See more info in the [docs](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/incremental-syncs).",
1855-
title="Whether to store cursor as one value instead of per partition",
1875+
description="Setting to True causes the connector to store the cursor as one value, instead of per-partition. This setting optimizes performance when the parent stream has thousands of partitions. Notably, the substream state is updated only at the end of the sync, which helps prevent data loss in case of a sync failure. See more info in the [docs](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/incremental-syncs).",
1876+
title="Global Substream Cursor",
18561877
)
18571878
lookback_window: Optional[str] = Field(
18581879
None,
1859-
description="Time interval before the start_datetime to read data for, e.g. P1M for looking back one month.",
1880+
description="Time interval (ISO8601 duration) before the start_datetime to read data for, e.g. P1M for looking back one month.\n * **PT1H**: 1 hour\n * **P1D**: 1 day\n * **PT1W**: 1 week\n * **P1M**: 1 month\n * **P1Y**: 1 year\n",
18601881
examples=["P1D", "P{{ config['lookback_days'] }}D"],
18611882
title="Lookback Window",
18621883
)
@@ -1874,7 +1895,7 @@ class DatetimeBasedCursor(BaseModel):
18741895
)
18751896
step: Optional[str] = Field(
18761897
None,
1877-
description="The size of the time window (ISO8601 duration). Given this field is provided, `cursor_granularity` needs to be provided as well.",
1898+
description="The size of the time window (ISO8601 duration). Given this field is provided, `cursor_granularity` needs to be provided as well.\n * **PT1H**: 1 hour\n * **P1D**: 1 day\n * **PT1W**: 1 week\n * **P1M**: 1 month\n * **P1Y**: 1 year\n",
18781899
examples=["P1W", "{{ config['step_increment'] }}"],
18791900
title="Step",
18801901
)
@@ -2492,7 +2513,7 @@ class SessionTokenAuthenticator(BaseModel):
24922513
)
24932514
expiration_duration: Optional[str] = Field(
24942515
None,
2495-
description="The duration in ISO 8601 duration notation after which the session token expires, starting from the time it was obtained. Omitting it will result in the session token being refreshed for every request.",
2516+
description="The duration in ISO 8601 duration notation after which the session token expires, starting from the time it was obtained. Omitting it will result in the session token being refreshed for every request.\n * **PT1H**: 1 hour\n * **P1D**: 1 day\n * **PT1W**: 1 week\n * **P1M**: 1 month\n * **P1Y**: 1 year\n",
24962517
examples=["PT1H", "P1D"],
24972518
title="Expiration Duration",
24982519
)

0 commit comments

Comments
 (0)