Skip to content

Conversation

@Prab-27
Copy link
Contributor

@Prab-27 Prab-27 commented Jul 31, 2025

Related discussion : here

This PR is part of the migration to SQLAlchemy 2.0

Removed session.query() from src and tests


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@Prab-27 Prab-27 force-pushed the remove-query-obj-from-providers-fab branch from 953c467 to 56773ae Compare August 3, 2025 10:50
@Prab-27 Prab-27 force-pushed the remove-query-obj-from-providers-fab branch from 56773ae to 9412a3a Compare August 10, 2025 12:14
@Prab-27 Prab-27 marked this pull request as ready for review August 11, 2025 03:32
@Prab-27 Prab-27 requested a review from vincbeck as a code owner August 11, 2025 03:32
@potiuk
Copy link
Member

potiuk commented Aug 19, 2025

conflicts to solve :(

@Prab-27
Copy link
Contributor Author

Prab-27 commented Aug 19, 2025

I need to deep dive into pre-commit hook because it doesn't detect certain patterns session.query code from fab like

security_manager.sync_roles()
    num_pv_before = db.session().query(ab_perm_role).count()
    security_manager.sync_roles()
    num_pv_after = db.session().query(ab_perm_role).count()
    assert num_pv_before == num_pv_after
        sesh = self.appbuilder.get_session
        perms = sesh.query(Permission).filter(
            or_(
                Permission.action == None,  # noqa: E711
                Permission.resource == None,  # noqa: E711
            )
        )

@Prab-27 Prab-27 force-pushed the remove-query-obj-from-providers-fab branch 3 times, most recently from 64867c1 to 380232d Compare August 28, 2025 10:42
@Prab-27
Copy link
Contributor Author

Prab-27 commented Aug 28, 2025

Thanks I'll update pre-commit hook

@Prab-27 Prab-27 force-pushed the remove-query-obj-from-providers-fab branch from 380232d to a9772b4 Compare August 28, 2025 12:52
@Prab-27
Copy link
Contributor Author

Prab-27 commented Aug 28, 2025

Sorry! I forgot to include this earlier. It's updated now.

@vincbeck
Copy link
Contributor

Nice! It detected some missing then (a good proof it works :))

@Prab-27
Copy link
Contributor Author

Prab-27 commented Aug 28, 2025

Apologies—some query objects were still present. I should have reviewed them earlier. I'll update the code shortly

@Prab-27 Prab-27 force-pushed the remove-query-obj-from-providers-fab branch from a9772b4 to 7db69c1 Compare August 29, 2025 09:40
@Prab-27 Prab-27 requested a review from vincbeck August 29, 2025 13:59
@vincbeck vincbeck merged commit 06ca8a9 into apache:main Aug 29, 2025
73 checks passed
mangal-vairalkar pushed a commit to mangal-vairalkar/airflow that referenced this pull request Aug 30, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
nothingmin pushed a commit to nothingmin/airflow that referenced this pull request Sep 2, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Sep 30, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 1, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 2, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 3, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 4, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
* remove session.query from tests

* remove session.query from fab/src

* fix errors

* Removed unnecessary comments code and applied small fixes

* resolved conflict and removed session.query from it

* remove .query()

* fix static checks

* fix static checks

* fix import error

* include fab provider in pre-commit check

* remove query obj from test_user_endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants