apache / apache/airflow

Clean up unneeded unique() calls on ORM

Open
#43,068 0 comments 0 reactions 0 assignees View on GitHub
affected_version:main_branch area:core kind:meta
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 10h
Merged PRs (30d)
483

Description

### Body

Similar to #43064. Maybe there are more to be had? cc @dstandish

I can find 6 with a naive text search in main, 4 in main and 2 in providers. We should review them individually.

https://github.com/apache/airflow/blob/e20146d44b340f719f7fb432f93741e011690558/airflow/assets/manager.py#L161-L167

https://github.com/apache/airflow/blob/e20146d44b340f719f7fb432f93741e011690558/airflow/dag_processing/collection.py#L64-L75

https://github.com/apache/airflow/blob/e20146d44b340f719f7fb432f93741e011690558/airflow/jobs/scheduler_job_runner.py#L1327-L1338

https://github.com/apache/airflow/blob/e20146d44b340f719f7fb432f93741e011690558/airflow/www/views.py#L1000-L1006

https://github.com/apache/airflow/blob/e20146d44b340f719f7fb432f93741e011690558/providers/src/airflow/providers/fab/auth_manager/api_endpoints/role_and_permission_endpoint.py#L88-L92

https://github.com/apache/airflow/blob/e20146d44b340f719f7fb432f93741e011690558/providers/src/airflow/providers/fab/auth_manager/security_manager/override.py#L2792-L2799

(There is a 7th `unique()` match in a Jinja2 template.)

### Committer

- [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Contributor guide

Open the contributing guide

Research direction

Start with the six linked Python call sites and search for the seventh occurrence in the Jinja2 template. Review each unique() call individually, including the provider files, and run the relevant Airflow tests after each change. Done means only unnecessary calls are removed without changing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.