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

Fix SQLAlchemy warning about a cartesian product #90

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

FrostyX
Copy link
Member

@FrostyX FrostyX commented Feb 11, 2025

Fix #72

SAWarning: SELECT statement has a cartesian product between FROM element(s)
"entry" and FROM element "user".  Apply join condition(s) between each
element to resolve.

Fix fedora-copr#72

    SAWarning: SELECT statement has a cartesian product between FROM element(s)
    "entry" and FROM element "user".  Apply join condition(s) between each
    element to resolve.
@xsuchy xsuchy self-requested a review February 17, 2025 12:33
@xsuchy
Copy link
Member

xsuchy commented Feb 18, 2025

Hmm git-blame say that the code was added in a3e3d8a and the test table has 3 records. And the test do cartesian product and test if search for "chuck" returns 3 records (one row joined with every row from aliased table). And the test check if the whoshee can work with aliased table.
Ergo, I think the code should be left intact and the warning should be silenced:
https://stackoverflow.com/questions/5225780/turn-off-a-warning-in-sqlalchemy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SAWarning: SELECT statement has a cartesian product
2 participants