You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/10/27 06:35:06 UTC

[GitHub] [airflow] ShaharPotash1 opened a new issue #19241: next_ds changed to proxy and it cannot be used in ds_add macro function

ShaharPotash1 opened a new issue #19241:
URL: https://github.com/apache/airflow/issues/19241


   ### Apache Airflow version
   
   2.2.0 (latest released)
   
   ### Operating System
   
   Ubuntu
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   Tried to use this this code:
   `some_variable='{{macros.ds_format(macros.ds_add(next_ds, '
                    '(ti.start_date - ti.execution_date).days), '
                    '"%Y-%m-%d", "%Y-%m-%d 21:00:00")}}')`
   but got this error:
   `strptime() argument 1 must be str, not Proxy`
   because the `next_ds` variable changed to proxy.
   
   ### What you expected to happen
   
   _No response_
   
   ### How to reproduce
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] uranusjr commented on issue #19241: next_ds changed to proxy and it cannot be used in ds_add macro function

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #19241:
URL: https://github.com/apache/airflow/issues/19241#issuecomment-952587483


   I think we need to explicitly cast inputs with `str()` in `airflow/macros/__init__.py`. For example:
   
   ```python
   def ds_add(ds, days):
       ds = datetime.strptime(str(ds), '%Y-%m-%d')  # Note the extra str() call.
       ...
   ```
   
   Fancy a pull request fixing this? Some tests to make sure this doesn't regress would probably be needed.


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] ShaharPotash1 commented on issue #19241: next_ds changed to proxy and it cannot be used in ds_add macro function

Posted by GitBox <gi...@apache.org>.
ShaharPotash1 commented on issue #19241:
URL: https://github.com/apache/airflow/issues/19241#issuecomment-952586289


   @potiuk 


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] potiuk closed issue #19241: next_ds changed to proxy and it cannot be used in ds_add macro function

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #19241:
URL: https://github.com/apache/airflow/issues/19241


   


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] boring-cyborg[bot] commented on issue #19241: next_ds changed to proxy and it cannot be used in ds_add macro function

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #19241:
URL: https://github.com/apache/airflow/issues/19241#issuecomment-952585809


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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-unsubscribe@airflow.apache.org

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