thaysa opened a new issue, #23973:
URL: https://github.com/apache/airflow/issues/23973
### Apache Airflow version
2.3.1 (latest released)
### What happened
requirements param behaves different in 2.2.X and 2.3.X
```
from airflow import DAG
from airflow.operators.python import PythonVirtualenvOperator
from airflow.utils.dates import days_ago
def my_func():
print("***************************")
with DAG(dag_id="python_virtual_env_requirements", schedule_interval=None,
catchup=False,
start_date=days_ago(1)) as dag:
task_2_2_X = PythonVirtualenvOperator(
task_id="task_2_2_X",
python_callable=my_func,
requirements=["my_lib", "--extra-index-url",
"https://my_artifactory_url"],
system_site_packages=True,
)
task_2_3_X = PythonVirtualenvOperator(
task_id="task_2_3_X",
python_callable=my_func,
requirements=["my_lib", "--extra-index-url
https://my_artifactory_url"],
system_site_packages=True,
)
```
### Env - Airflow 2.2.X
#### task_2_2_X:
```
INFO - Executing cmd: /tmp/venvip2jb2zp/bin/pip install my_lib
--extra-index-url https://my_artifactory_url
INFO - Output:
INFO - Looking in indexes: https://pypi.org/simple,
https://my_artifactory_url
```
#### task_2_3_X:
`INFO - no such option: --extra-index-url https://my_artifactory_url`
### Env - Airflow 2.3.X
#### task_2_2_X:
```
INFO - Executing cmd: /tmp/venv8q9vdmv6/bin/pip install -r
/tmp/venv8q9vdmv6/requirements.txt
INFO - Output:
INFO - Usage: pip [options]
INFO -
INFO - ERROR: Invalid requirement: --extra-index-url
INFO - pip: error: --extra-index-url option requires 1 argument
```
#### task_2_3_X:
```
INFO - Executing cmd: /tmp/venv2fm5h7be/bin/pip install -r
/tmp/venv2fm5h7be/requirements.txt
INFO - Output:
INFO - Looking in indexes: https://pypi.org/simple,
https://my_artifactory_url
```
### What you think should happen instead
_No response_
### How to reproduce
_No response_
### Operating System
N/A
### Versions of Apache Airflow Providers
_No response_
### Deployment
Docker-Compose
### Deployment details
_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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]