Skip to content

Commit

Permalink
Fix bug in validate-operators-init pre-commit (apache#38014)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahar1 authored Mar 10, 2024
1 parent 5203029 commit 6838072
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,19 @@ repos:
pass_filenames: true
files: ^airflow/providers/.*/(operators|transfers|sensors)/.*\.py$
additional_dependencies: [ 'rich>=12.4.4' ]
# TODO: Handle the provider-specific exclusions and remove them from the list, see:
# https://github.com/apache/airflow/issues/36484
exclude: |
(?x)^(
^airflow\/providers\/google\/cloud\/operators\/mlengine.py$|
^airflow\/providers\/google\/cloud\/operators\/vertex_ai\/custom_job.py$|
^airflow\/providers\/google\/cloud\/operators\/cloud_storage_transfer_service.py$|
^airflow\/providers\/apache\/spark\/operators\/spark_submit.py\.py$|
^airflow\/providers\/google\/cloud\/operators\/vertex_ai\/auto_ml\.py$|
^airflow\/providers\/apache\/spark\/operators\/spark_submit\.py$|
^airflow\/providers\/apache\/spark\/operators\/spark_sql\.py$|
^airflow\/providers\/databricks\/operators\/databricks_sql\.py$|
)$
- id: ruff
name: Run 'ruff' for extremely fast Python linting
description: "Run 'ruff' for extremely fast Python linting"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _handle_assigned_field(
:param target: The target field.
:param value: The value of the field.
"""
if not isinstance(value, ast.Name):
if not isinstance(value, ast.Name) or target.attr != value.id:
invalid_assignments.append(target.attr)
else:
assigned_template_fields.append(target.attr)
Expand Down

0 comments on commit 6838072

Please sign in to comment.