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 2020/05/20 23:17:09 UTC

[GitHub] [airflow] danly opened a new issue #8939: next_execution_date is not a pendulum instance

danly opened a new issue #8939:
URL: https://github.com/apache/airflow/issues/8939


   **Apache Airflow version**: 1.10.2
   
   **What happened**:
   [According to the docs](https://airflow.apache.org/docs/stable/macros-ref.html) `next_execution_date` is a pendulum instance:
   
   > the next execution date (pendulum.Pendulum)
   
   However, when trying to call `start_of` method of `next_execution_date` it is a `datetime.datetime` instance.
   
   Code:
   ```python
   def execute(**kwargs):
     next_execution_date = kwargs.get('next_execution_date')
     stop = next_execution_date.start_of('day')
     #...
   ```
   
   Error Log:
   ```
   Subtask my_task stop = next_execution_date.start_of('day')
   Subtask my_task AttributeError: 'datetime.datetime' object has no attribute 'start_of'
   ```
   
   **How to reproduce it**:
   Try calling pendulum methods from `next_execution_date`
   
   **Stop-gap**:
   As a temporary fix, I am creating a pendulum instance from the `datetime.datetime` object.
   
   ```
   def execute(**kwargs):
     next_execution_date = kwargs.get('next_execution_date')
     stop = pendulum.instance(next_execution_date).start_of('day')
     #...
   ```


----------------------------------------------------------------
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.

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



[GitHub] [airflow] danly commented on issue #8939: next_execution_date is not a pendulum instance

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


   Thanks @rootcss I didn't realize I was looking at the wrong docs.


----------------------------------------------------------------
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.

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



[GitHub] [airflow] rootcss commented on issue #8939: next_execution_date is not a pendulum instance

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


   @mik-laj This can be closed.


----------------------------------------------------------------
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.

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



[GitHub] [airflow] rootcss edited a comment on issue #8939: next_execution_date is not a pendulum instance

Posted by GitBox <gi...@apache.org>.
rootcss edited a comment on issue #8939:
URL: https://github.com/apache/airflow/issues/8939#issuecomment-664021109


   @mik-laj This issue can be closed.


----------------------------------------------------------------
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.

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



[GitHub] [airflow] danly closed issue #8939: next_execution_date is not a pendulum instance

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


   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] rootcss commented on issue #8939: next_execution_date is not a pendulum instance

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


   @danly I think, you're looking at the docs of the latest stable version. For v1.10.2 you can refer the docs here: https://airflow.apache.org/docs/1.10.2/code.html#macros - which mentions `{{ next_execution_date }}` an instance of `datetime.datetime`


----------------------------------------------------------------
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.

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



[GitHub] [airflow] boring-cyborg[bot] commented on issue #8939: next_execution_date is not a pendulum instance

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


   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.

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