Skip to content

Commit

Permalink
Check if map_index is accidentally used in providers. (#22817)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 80dc72b44536d0fc0fecfcc28cdc2fddd641a5db
  • Loading branch information
potiuk authored and Cloud Composer Team committed Sep 12, 2024
1 parent 670da2b commit 0089318
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/ci/pre_commit/pre_commit_check_2_1_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ def _check_file(_file: Path):
f"[yellow]You should not use coerce_datetime in providers "
f"as it is not available in Airflow 2.1[/]"
)
if "ti.map_index" in line:
errors.append(
f"[red]In {_file}:{index} there is a forbidden construct "
f"(Airflow 2.3+ only):[/]\n\n"
f"{lines[index]}\n\n"
f"[yellow]You should not use map_index field in providers "
f"as it is not available in Airflow 2.2[/]"
)


if __name__ == '__main__':
Expand Down

0 comments on commit 0089318

Please sign in to comment.