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 2022/07/05 08:16:05 UTC
[GitHub] [airflow] gcerar opened a new issue, #24839: PythonVirtualenvOperator can't access task_instance variable
gcerar opened a new issue, #24839:
URL: https://github.com/apache/airflow/issues/24839
### Apache Airflow version
2.3.2 (latest released)
### What happened
Using the provided minimal example, `task_instance` (i.e., `ti`) is accessible when using `PythonOperator` but fails when using `PythonVirtualenvOperator`.
### What you think should happen instead
I would expect `PythonOperator` and `PythonVirtualenvOperator` to behave in a similar way. Instead, none of the xcom examples example work with `PythonVirtualenvOperator`.
### How to reproduce
Switch between `PythonOperator` and `PythonVirtualenvOperator`. Using `PythonVirtualenvOperator` dag will fail.
```python
from airflow import DAG
from airflow.operators.python import PythonVirtualenvOperator, PythonOperator
from datetime import datetime, timedelta
def _pusher(ti):
ti.xcom_push(key='my-key', value='my-value')
def _puller(ti):
value = ti.xcom_pull(task_ids='pusher', key='my-key')
assert value == 'my-value'
with DAG('minimal-example', schedule_interval='@once', start_date=datetime(2021, 1, 1), catchup=False) as dag:
#pusher = PythonVirtualenvOperator(
pusher = PythonOperator(
task_id='pusher',
python_callable=_pusher,
#requirements=[],
)
#puller = PythonVirtualenvOperator(
puller = PythonOperator(
task_id='puller',
python_callable=_puller,
#requirements=[],
)
pusher >> puller
```
### Operating System
Ubuntu 20.04
### Versions of Apache Airflow Providers
Apache airflow 2.3.2 in docker container
### Deployment
Docker-Compose
### Deployment details
https://github.com/apache/airflow/blob/2.3.2/docs/apache-airflow/start/docker-compose.yaml
### 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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] eladkal commented on issue #24839: PythonVirtualenvOperator can't access task_instance variable
Posted by GitBox <gi...@apache.org>.
eladkal commented on issue #24839:
URL: https://github.com/apache/airflow/issues/24839#issuecomment-1174819526
Looks like duplicate of https://github.com/apache/airflow/issues/12985
--
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] eladkal closed issue #24839: PythonVirtualenvOperator can't access task_instance variable
Posted by GitBox <gi...@apache.org>.
eladkal closed issue #24839: PythonVirtualenvOperator can't access task_instance variable
URL: https://github.com/apache/airflow/issues/24839
--
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 #24839: PythonVirtualenvOperator can't access task_instance variable
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #24839:
URL: https://github.com/apache/airflow/issues/24839#issuecomment-1174757695
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