Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

templates_dict, op_args, op_kwargs no longer rendered in PythonVirtualenvOperator #23557

Closed
2 tasks done
lssatvik opened this issue May 7, 2022 · 4 comments · Fixed by #23559
Closed
2 tasks done

templates_dict, op_args, op_kwargs no longer rendered in PythonVirtualenvOperator #23557

lssatvik opened this issue May 7, 2022 · 4 comments · Fixed by #23559
Assignees
Labels
affected_version:2.3 Issues Reported for 2.3 area:core-operators Operators, Sensors and hooks within Core Airflow kind:bug This is a clearly a bug
Milestone

Comments

@lssatvik
Copy link

lssatvik commented May 7, 2022

Apache Airflow version

2.3.0 (latest released)

What happened

Templated strings in templates_dict, op_args, op_kwargs of PythonVirtualenvOperator are no longer rendered.

What you think should happen instead

All templated strings in templates_dict, op_args and op_kwargs must be rendered, i.e. these 3 arguments must be template_fields of PythonVirtualenvOperator, as it was in Airflow 2.2.3

How to reproduce

No response

Operating System

Ubuntu 20.04

Versions of Apache Airflow Providers

No response

Deployment

Virtualenv installation

Deployment details

No response

Anything else

This is due to template_fields class variable being set in PythonVirtualenvOperator
template_fields: Sequence[str] = ('requirements',)
that overrode class variable of PythonOperator
template_fields = ('templates_dict', 'op_args', 'op_kwargs').
I read in some discussion that wanted to make requirements a template field for PythonVirtualenvOperator, but we must specify all template fields of parent class as well.
template_fields: Sequence[str] = ('templates_dict', 'op_args', 'op_kwargs', 'requirements',)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@lssatvik lssatvik added area:core kind:bug This is a clearly a bug labels May 7, 2022
@lssatvik lssatvik changed the title templates_dict, op_args, op_kwargs no longer templated fields for PythonVirtualenvOperator templates_dict, op_args, op_kwargs no longer template fields in PythonVirtualenvOperator May 7, 2022
@lssatvik lssatvik changed the title templates_dict, op_args, op_kwargs no longer template fields in PythonVirtualenvOperator templates_dict, op_args, op_kwargs no longer rendered in PythonVirtualenvOperator May 7, 2022
@eladkal eladkal self-assigned this May 7, 2022
@eladkal eladkal added this to the Airflow 2.3.1 milestone May 7, 2022
@eladkal eladkal added area:core-operators Operators, Sensors and hooks within Core Airflow and removed area:core labels May 7, 2022
eladkal added a commit to eladkal/airflow that referenced this issue May 7, 2022
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: apache#23557
@eladkal eladkal added the affected_version:2.3 Issues Reported for 2.3 label May 7, 2022
@lssatvik
Copy link
Author

lssatvik commented May 8, 2022

Nice. Was wondering how to "inherit" class variables.

@lssatvik
Copy link
Author

lssatvik commented May 8, 2022

@eladkal Doesn't the length of template_ext need to match length of template_fields?

@lssatvik
Copy link
Author

lssatvik commented May 8, 2022

Nvm, as requirements is first, doesn't matter.

@lssatvik lssatvik closed this as completed May 8, 2022
@eladkal
Copy link
Contributor

eladkal commented May 8, 2022

Lets leave issue open till the fix is merged

@eladkal eladkal reopened this May 8, 2022
eladkal added a commit that referenced this issue May 9, 2022
* Fix `PythonVirtualenvOperator` templated_fields
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: #23557
ephraimbuddy pushed a commit that referenced this issue May 17, 2022
* Fix `PythonVirtualenvOperator` templated_fields
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: #23557

(cherry picked from commit 1657bd2)
ephraimbuddy pushed a commit that referenced this issue May 21, 2022
* Fix `PythonVirtualenvOperator` templated_fields
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: #23557

(cherry picked from commit 1657bd2)
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 4, 2022
* Fix `PythonVirtualenvOperator` templated_fields
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: apache/airflow#23557

(cherry picked from commit 1657bd2827a3299a91ae0abbbfe4f6b80bd4cdc0)

GitOrigin-RevId: 08a771b805c64b0016d95fcbc9d4c98f7267b071
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Dec 7, 2022
* Fix `PythonVirtualenvOperator` templated_fields
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: apache/airflow#23557

(cherry picked from commit 1657bd2827a3299a91ae0abbbfe4f6b80bd4cdc0)

GitOrigin-RevId: 08a771b805c64b0016d95fcbc9d4c98f7267b071
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jan 27, 2023
* Fix `PythonVirtualenvOperator` templated_fields
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: apache/airflow#23557
GitOrigin-RevId: 1657bd2827a3299a91ae0abbbfe4f6b80bd4cdc0
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this issue Sep 12, 2024
* Fix `PythonVirtualenvOperator` templated_fields
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: apache/airflow#23557

(cherry picked from commit 1657bd2827a3299a91ae0abbbfe4f6b80bd4cdc0)

GitOrigin-RevId: 08a771b805c64b0016d95fcbc9d4c98f7267b071
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 18, 2024
* Fix `PythonVirtualenvOperator` templated_fields
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: apache/airflow#23557
GitOrigin-RevId: 1657bd2827a3299a91ae0abbbfe4f6b80bd4cdc0
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Nov 7, 2024
* Fix `PythonVirtualenvOperator` templated_fields
The `PythonVirtualenvOperator` templated_fields override `PythonOperator` templated_fields which caused functionality not to work as expected.
fixes: apache/airflow#23557
GitOrigin-RevId: 1657bd2827a3299a91ae0abbbfe4f6b80bd4cdc0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected_version:2.3 Issues Reported for 2.3 area:core-operators Operators, Sensors and hooks within Core Airflow kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants