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/03/04 15:54:45 UTC

[GitHub] [airflow] kaxil opened a new pull request #14603: Support jinja2 native Python types

kaxil opened a new pull request #14603:
URL: https://github.com/apache/airflow/pull/14603


   This is second attempt to https://github.com/apache/airflow/pull/4900
   
   Docs: https://jinja.palletsprojects.com/en/2.11.x/nativetypes/
   
   ```python
   >>> from jinja2 import nativetypes
   >>> ne = nativetypes.NativeEnvironment()
   >>> import pendulum
   >>> ne.from_string('{{ x }}').render(x=pendulum.now())
   <Pendulum [2021-03-04T15:33:17.073343+00:00]>
   
   >>> ne.from_string('{{ x }}').render(x=pendulum.now().isoformat())
   '2021-03-04T15:33:29.516540+00:00'
   >>> ne.from_string('{{ x }}').render(x="2012-10-10")
   '2012-10-10'
   ```
   
   Current:
   
   ```python
   >>> environment.Environment().from_string('{{ ["w","x"] }}').render()
   "['w', 'x']"
   ```
   
   Proposed:
   ```python
   >>> nativetypes.NativeEnvironment().from_string('{{ ["w","x"] }}').render()
   ['w', 'x']
   ```
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.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.

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



[GitHub] [airflow] kaxil commented on pull request #14603: Support jinja2 native Python types

Posted by GitBox <gi...@apache.org>.
kaxil commented on pull request #14603:
URL: https://github.com/apache/airflow/pull/14603#issuecomment-833473068


   Tests are green, ping @ashb @turbaszek 


-- 
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] turbaszek commented on pull request #14603: Support jinja2 native Python types

Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #14603:
URL: https://github.com/apache/airflow/pull/14603#issuecomment-798787715


   I think that flag on DAG level will make things more consistent. The `nt` solution proposed by @ashb is interesting one but it's a bit of additional work - at least to me.
   
   Whatever we will decide - lets extend the docs to cover this feature 👌 
   


----------------------------------------------------------------
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] github-actions[bot] commented on pull request #14603: Support jinja2 native Python types

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14603:
URL: https://github.com/apache/airflow/pull/14603#issuecomment-833477643


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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] kaxil edited a comment on pull request #14603: Support jinja2 native Python types

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on pull request #14603:
URL: https://github.com/apache/airflow/pull/14603#issuecomment-833473068


   Added docs & Tests are green, ping @ashb @turbaszek 


-- 
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] github-actions[bot] commented on pull request #14603: Support jinja2 native Python types

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14603:
URL: https://github.com/apache/airflow/pull/14603#issuecomment-832375379


   [The Workflow run](https://github.com/apache/airflow/actions/runs/812030168) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


-- 
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] kaxil commented on pull request #14603: Support jinja2 native Python types

Posted by GitBox <gi...@apache.org>.
kaxil commented on pull request #14603:
URL: https://github.com/apache/airflow/pull/14603#issuecomment-826005787


   Re-thinking this -- I agree with Tomek that keeping it same per DAG makes it more consistent and reason about and remove complexity.
   
   @ashb WDYT? If you agree with current approach, I can add docs to describe this feature


-- 
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] ashb commented on pull request #14603: Support jinja2 native Python types

Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #14603:
URL: https://github.com/apache/airflow/pull/14603#issuecomment-830034204


   Sure, I guess this will work and it's unlikely people will want to mix them in one dag? Not sure.
   
   Docs now please!


-- 
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] kaxil commented on pull request #14603: Support jinja2 native Python types

Posted by GitBox <gi...@apache.org>.
kaxil commented on pull request #14603:
URL: https://github.com/apache/airflow/pull/14603#issuecomment-832365079


   > Sure, I guess this will work and it's unlikely people will want to mix them in one dag? Not sure.
   > 
   > Docs now please!
   
   Done in https://github.com/apache/airflow/pull/14603/commits/4aacd2bef6587e93b1047b05ca57f4790c701282


-- 
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] kaxil merged pull request #14603: Support jinja2 native Python types

Posted by GitBox <gi...@apache.org>.
kaxil merged pull request #14603:
URL: https://github.com/apache/airflow/pull/14603


   


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