uranusjr commented on code in PR #24724:
URL: https://github.com/apache/airflow/pull/24724#discussion_r909593111
##########
airflow/templates.py:
##########
@@ -56,9 +56,11 @@ def ts_filter(value):
return value.isoformat()
-def ts_nodash_filter(value):
- return value.strftime('%Y%m%dT%H%M%S')
-
+def ts_nodash_filter(*value):
+ if value:
+ return value.strftime('%Y%m%dT%H%M%S')
+ else:
+ return None
Review Comment:
This is wrong since
1. `datetime(0, 0, 0)` is falsy.
2. The `*` should not exist.
Something like this should be implemented instead
```python
def ts_nodash_filter(value):
if value is None:
return None
return value.strftime('%Y%m%dT%H%M%S')
```
Also please add the same logic to `ds_filter`, `ds_nodash_filter`,
`ts_filter`, and `ts_nodash_with_tz_filter` as well.
--
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]