feat: Persist Variables for Enhanced Debugging Workflow (#20699)
This pull request introduces a feature aimed at improving the debugging experience during workflow editing. With the addition of variable persistence, the system will automatically retain the output variables from previously executed nodes. These persisted variables can then be reused when debugging subsequent nodes, eliminating the need for repetitive manual input. By streamlining this aspect of the workflow, the feature minimizes user errors and significantly reduces debugging effort, offering a smoother and more efficient experience. Key highlights of this change: - Automatic persistence of output variables for executed nodes. - Reuse of persisted variables to simplify input steps for nodes requiring them (e.g., `code`, `template`, `variable_assigner`). - Enhanced debugging experience with reduced friction. Closes #19735.
This commit is contained in:
20
api/tests/unit_tests/libs/test_datetime_utils.py
Normal file
20
api/tests/unit_tests/libs/test_datetime_utils.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import datetime
|
||||
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
|
||||
|
||||
def test_naive_utc_now(monkeypatch):
|
||||
tz_aware_utc_now = datetime.datetime.now(tz=datetime.UTC)
|
||||
|
||||
def _now_func(tz: datetime.timezone | None) -> datetime.datetime:
|
||||
return tz_aware_utc_now.astimezone(tz)
|
||||
|
||||
monkeypatch.setattr("libs.datetime_utils._now_func", _now_func)
|
||||
|
||||
naive_datetime = naive_utc_now()
|
||||
|
||||
assert naive_datetime.tzinfo is None
|
||||
assert naive_datetime.date() == tz_aware_utc_now.date()
|
||||
naive_time = naive_datetime.time()
|
||||
utc_time = tz_aware_utc_now.time()
|
||||
assert naive_time == utc_time
|
Reference in New Issue
Block a user