potiuk merged PR #41363:
URL: https://github.com/apache/airflow/pull/41363
--
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.a
phi-friday commented on PR #41363:
URL: https://github.com/apache/airflow/pull/41363#issuecomment-2284276583
https://github.com/apache/airflow/blob/4e62909ff5fc92eb19676fb3266cd935cd42df55/airflow/serialization/serialized_objects.py#L630
If AIP44 is not enabled, an error is thrown.
potiuk commented on PR #41363:
URL: https://github.com/apache/airflow/pull/41363#issuecomment-2282859662
Ah yes. This is because serialization uses Pydantic currently to serialize
DB models that are part of the context and that requires Pydantic v2 to be
installed. I'd say we should make th
phi-friday commented on PR #41363:
URL: https://github.com/apache/airflow/pull/41363#issuecomment-2278522365
I don't know if this is allowed.
Modifying the model as follows did not cause the problem,
even if it was `pydantic<2` or `none` (I checked in local).
in `airflow.uti
phi-friday commented on PR #41363:
URL: https://github.com/apache/airflow/pull/41363#issuecomment-2278412868
Based on the error message given by #41362, I checked and it only works with
`pydantic>=2`.
I think we need to either modify the function `_pydantic_model_dump` or set
`use_pydant
phi-friday commented on PR #41363:
URL: https://github.com/apache/airflow/pull/41363#issuecomment-2278362410
> ~something is wrong as it shows 0 files changed~ ah you need to wait till
the revert PR is merged. otherwise the diff is nothing
I'm not sure what to do as I've never seen th
eladkal commented on PR #41363:
URL: https://github.com/apache/airflow/pull/41363#issuecomment-2278356767
something is wrong as it shows 0 files changed
--
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
eladkal closed pull request #41363: Send context using in venv operator
URL: https://github.com/apache/airflow/pull/41363
--
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 uns
phi-friday opened a new pull request, #41363:
URL: https://github.com/apache/airflow/pull/41363
origin: #41039
related: #41362
---
**^ Add meaningful description above**
Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/con
shahar1 merged PR #41039:
URL: https://github.com/apache/airflow/pull/41039
--
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.
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1709899252
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,76 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_scr
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1709805963
##
newsfragments/41039.feature.rst:
##
@@ -0,0 +1 @@
+Enable ``get_current_context()`` to work in virtual environments. This is a
dictionary object, not a model d
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1709621116
##
airflow/utils/python_virtualenv_script.jinja2:
##
@@ -64,6 +64,20 @@ with open(sys.argv[3], "r") as file:
virtualenv_string_args = list(map(lambda x: x.str
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1709166971
##
airflow/utils/python_virtualenv_script.jinja2:
##
@@ -64,6 +64,20 @@ with open(sys.argv[3], "r") as file:
virtualenv_string_args = list(map(lambda x: x.str
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1709086949
##
airflow/utils/python_virtualenv_script.jinja2:
##
@@ -64,6 +64,20 @@ with open(sys.argv[3], "r") as file:
virtualenv_string_args = list(map(lambda x: x.str
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1709090240
##
newsfragments/41039.feature.rst:
##
@@ -0,0 +1 @@
+Enable ``get_current_context()`` to work in virtual environments. This is a
dictionary object, not a model d
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1709086949
##
airflow/utils/python_virtualenv_script.jinja2:
##
@@ -64,6 +64,20 @@ with open(sys.argv[3], "r") as file:
virtualenv_string_args = list(map(lambda x: x.str
shahar1 commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1708689743
##
airflow/utils/python_virtualenv_script.jinja2:
##
@@ -64,6 +64,20 @@ with open(sys.argv[3], "r") as file:
virtualenv_string_args = list(map(lambda x: x.strip(
eladkal commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1708625228
##
newsfragments/41039.feature.rst:
##
@@ -0,0 +1 @@
+Enable ``get_current_context()`` to work in virtual environments. This is a
dictionary object, not a model defi
eladkal commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1708622496
##
docs/apache-airflow/howto/operator/python.rst:
##
@@ -102,6 +102,37 @@ is evaluated as a :ref:`Jinja template
`.
:start-after: [START howto_operator_
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1708236351
##
airflow/utils/python_virtualenv_script.jinja2:
##
@@ -64,6 +64,20 @@ with open(sys.argv[3], "r") as file:
virtualenv_string_args = list(map(lambda x: x.str
shahar1 commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1707600224
##
airflow/utils/python_virtualenv_script.jinja2:
##
@@ -64,6 +64,20 @@ with open(sys.argv[3], "r") as file:
virtualenv_string_args = list(map(lambda x: x.strip(
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1704020598
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,76 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_scr
potiuk commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703995966
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,76 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_script.
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703983380
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,76 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_scr
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703983380
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,76 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_scr
potiuk commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2268352156
> One question, why can we not always provide the context when possible?
Does this have a negative effect when the context is not needed?
I think it's a bit safer approach this way
phi-friday commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2268336573
> One question, why can we not always provide the context when possible?
Does this have a negative effect when the context is not needed?
I used `use_airflow_context` to separa
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703636739
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,76 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_scr
uranusjr commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2268241037
One question, why can we not always provide the context when possible? Does
this have a negative effect when the context is not needed?
--
This is an automated message from the Apach
potiuk commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703573760
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,76 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_script.
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703508029
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,76 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_scr
potiuk commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703370328
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,76 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_script.
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703249475
##
newsfragments/41039.feature.rst:
##
@@ -0,0 +1 @@
+Enable ``get_current_context()`` to work in virtual environments with some
limitations.
Review Comment:
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703232479
##
newsfragments/41039.feature.rst:
##
@@ -0,0 +1 @@
+Enable ``get_current_context()`` to work in virtual environments with some
limitations.
Review Comment:
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703232479
##
newsfragments/41039.feature.rst:
##
@@ -0,0 +1 @@
+Enable ``get_current_context()`` to work in virtual environments with some
limitations.
Review Comment:
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703232479
##
newsfragments/41039.feature.rst:
##
@@ -0,0 +1 @@
+Enable ``get_current_context()`` to work in virtual environments with some
limitations.
Review Comment:
eladkal commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703230409
##
newsfragments/41039.feature.rst:
##
@@ -0,0 +1 @@
+Enable ``get_current_context()`` to work in virtual environments with some
limitations.
Review Comment:
Thi
eladkal commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1703230409
##
newsfragments/41039.feature.rst:
##
@@ -0,0 +1 @@
+Enable ``get_current_context()`` to work in virtual environments with some
limitations.
Review Comment:
Thi
phi-friday commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2267072735
> Amazing! To wrap it up, could you please [add a
newsfragment](https://github.com/apache/airflow/blob/main/contributing-docs/16_contribution_workflow.rst#step-4-prepare-pr)?
(featur
shahar1 commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1702832331
##
airflow/operators/python.py:
##
@@ -440,6 +440,7 @@ def __init__(
expect_airflow: bool = True,
skip_on_exit_code: int | Container[int] | None = N
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1702633675
##
airflow/operators/python.py:
##
@@ -440,6 +440,7 @@ def __init__(
expect_airflow: bool = True,
skip_on_exit_code: int | Container[int] | None
shahar1 commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1702524810
##
airflow/operators/python.py:
##
@@ -440,6 +440,7 @@ def __init__(
expect_airflow: bool = True,
skip_on_exit_code: int | Container[int] | None = N
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1702471228
##
airflow/operators/python.py:
##
@@ -440,6 +440,7 @@ def __init__(
expect_airflow: bool = True,
skip_on_exit_code: int | Container[int] | None
phi-friday commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2266374319
> LGTM overall - had some minor comments in the code plus a couple of
questions:
>
> 1. Did you check that it works for both `PythonVirtualenvOperator` and
`ExternalPythonOper
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1702467068
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,74 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_scr
phi-friday commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1702466741
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,74 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_scr
shahar1 commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1702318915
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,74 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_script
shahar1 commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1693387494
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,74 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_script
shahar1 commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1702322911
##
airflow/operators/python.py:
##
@@ -440,6 +440,7 @@ def __init__(
expect_airflow: bool = True,
skip_on_exit_code: int | Container[int] | None = N
shahar1 commented on code in PR #41039:
URL: https://github.com/apache/airflow/pull/41039#discussion_r1702318915
##
airflow/utils/python_virtualenv.py:
##
@@ -149,3 +157,74 @@ def write_python_script(
)
template = template_env.get_template("python_virtualenv_script
gyli commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2259562632
This PR looks good to me, at least for Airflow 2.
While the down side is it creates another version of serialized context. I
think ideally in Airflow 3, it can utilize serde to seri
phi-friday commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2252948381
sample dag script:
```python
from __future__ import annotations
from pendulum import datetime
from airflow.decorators import dag, task
@dag(start_date=da
potiuk commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2252767334
Always Be Rebased - this has been solved in main. Generally when in doubt,
always rebase your PR. Your PR is 10 commits behind already:
![image](https://github.com/user-attachment
phi-friday commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2252753700
> > The warning `RemovedInAirflow3Warning` is consistently occurring. What
can I modify to get it to pass...
>
>
https://github.com/apache/airflow/blob/main/contributing-docs/
potiuk commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2252642533
> The warning `RemovedInAirflow3Warning` is consistently occurring. What can
I modify to get it to pass...
https://github.com/apache/airflow/blob/main/contributing-docs/testing/un
phi-friday commented on PR #41039:
URL: https://github.com/apache/airflow/pull/41039#issuecomment-2252345843
The warning `RemovedInAirflow3Warning` is consistently occurring.
What can I modify to get it to pass...
--
This is an automated message from the Apache Git Service.
To respond t
phi-friday opened a new pull request, #41039:
URL: https://github.com/apache/airflow/pull/41039
related: #34158
allow `airflow.operators.python.get_current_context()` in venv without
`system_site_packages=True`
limits:
- use primitive data type instead of ai
58 matches
Mail list logo