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

low-code: Delete now_local macro #25404

Merged
merged 5 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
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
Expand Up @@ -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.
Expand Down Expand Up @@ -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: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down