Taragolis commented on code in PR #28930:
URL: https://github.com/apache/airflow/pull/28930#discussion_r1070095513
##########
airflow/macros/__init__.py:
##########
@@ -85,3 +86,12 @@ def datetime_diff_for_humans(dt: Any, since: DateTime | None
= None) -> str:
import pendulum
return pendulum.instance(dt).diff_for_humans(since)
+
+
+def deserialize(data: str) -> dict[Any, Any]:
Review Comment:
`deserialize` it is a bit broad name which could mean everything and might
confuse users.
##########
tests/macros/test_macros.py:
##########
@@ -89,3 +89,19 @@ def test_ds_format(ds, input_format, output_format,
expected):
def test_datetime_diff_for_humans(dt, since, expected):
result = macros.datetime_diff_for_humans(dt, since)
assert result == expected
+
+
[email protected](
+ "ds, expected",
Review Comment:
`ds` refers to date and known **ds** macro which might confuse devs. `value`
or `input_value` more suitable here
##########
airflow/macros/__init__.py:
##########
@@ -24,6 +24,7 @@
from typing import Any
import dateutil # noqa
+import yaml
Review Comment:
```suggestion
import airflow.utils.yaml as yaml
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]