diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_component_schema.yaml b/airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_component_schema.yaml index 2fb4beb4e72109..66f2101dded11a 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_component_schema.yaml +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_component_schema.yaml @@ -589,7 +589,6 @@ definitions: examples: - "2021-01-1T00:00:00Z" - "{{ now_utc() }}" - - "{{ now_local() }}" start_datetime: title: Start Datetime description: The datetime that determines the earliest record that should be synced. @@ -1974,12 +1973,6 @@ interpolation: - title: stream_state description: The current state of the stream. macros: - - title: Now (Local) - description: Returns the current date and time using the local to the machine running the sync. We recommend using now_utc() instead of now_local() because it is more predictable. - arguments: {} - return_type: Datetime - examples: - - "{{ now_local() }}" - title: Now (UTC) description: Returns the current date and time in the UTC timezone. arguments: {} diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/interpolation/macros.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/interpolation/macros.py index 4a576e7950f547..c01ff081ccdb42 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/interpolation/macros.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/interpolation/macros.py @@ -15,16 +15,6 @@ """ -def now_local() -> datetime.datetime: - """ - Current local date and time. - - Usage: - `"{{ now_local() }}" - """ - return datetime.datetime.now() - - def now_utc(): """ Current local date and time in UTC timezone @@ -127,5 +117,5 @@ def format_datetime(dt: Union[str, datetime.datetime], format: str) -> str: return _str_to_datetime(dt).strftime(format) -_macros_list = [now_local, now_utc, today_utc, timestamp, max, day_delta, duration, format_datetime] +_macros_list = [now_utc, today_utc, timestamp, max, day_delta, duration, format_datetime] macros = {f.__name__: f for f in _macros_list} diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/models/declarative_component_schema.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/models/declarative_component_schema.py index e3d5a509fa67af..5504bfc52fff8e 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/models/declarative_component_schema.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/models/declarative_component_schema.py @@ -860,7 +860,7 @@ class DatetimeBasedCursor(BaseModel): end_datetime: Union[str, MinMaxDatetime] = Field( ..., description="The datetime that determines the last record that should be synced.", - examples=["2021-01-1T00:00:00Z", "{{ now_utc() }}", "{{ now_local() }}"], + examples=["2021-01-1T00:00:00Z", "{{ now_utc() }}"], title="End Datetime", ) start_datetime: Union[str, MinMaxDatetime] = Field( diff --git a/airbyte-cdk/python/unit_tests/sources/declarative/interpolation/test_macros.py b/airbyte-cdk/python/unit_tests/sources/declarative/interpolation/test_macros.py index 012eb36f1ca510..4fcf4b4da00f04 100644 --- a/airbyte-cdk/python/unit_tests/sources/declarative/interpolation/test_macros.py +++ b/airbyte-cdk/python/unit_tests/sources/declarative/interpolation/test_macros.py @@ -11,7 +11,6 @@ @pytest.mark.parametrize( "test_name, fn_name, found_in_macros", [ - ("test_now_local", "now_local", True), ("test_now_utc", "now_utc", True), ("test_today_utc", "today_utc", True), ("test_max", "max", True),