ashb commented on a change in pull request #17451:
URL: https://github.com/apache/airflow/pull/17451#discussion_r684096786



##########
File path: airflow/templates.py
##########
@@ -30,3 +35,32 @@ def is_safe_attribute(self, obj, attr, value):
         ``_``) whilst still blocking internal or truely private attributes 
(``__`` prefixed ones).
         """
         return not jinja2.sandbox.is_internal_attribute(obj, attr)
+
+
+def ds_filter(value):
+    return value.strftime('%Y-%m-%d')
+
+
+def ds_nodash_filter(value):
+    return value.strftime('%Y%m%d')
+
+
+def ts_filter(value):
+    return value.isoformat()
+
+
+def ts_nodash_filter(value):
+    return value.strftime('%Y%m%dT%H%M%S')
+
+
+def ts_nodash_with_tz_filter(value):
+    return value.isoformat().replace('-', '').replace(':', '')
+
+
+FILTERS = {
+    'ds': ds_filter,
+    'ds_no_dash': ds_nodash_filter,
+    'ts': ts_filter,
+    'ts_no_dash': ts_nodash_filter,
+    'ts_no_dash_with_tz': ts_nodash_with_tz_filter,

Review comment:
       Oh yeah, that was not an intentional change.




-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to