Skip to content

fix sqlalchemy relations #1

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

Merged
merged 1 commit into from
May 16, 2022
Merged

fix sqlalchemy relations #1

merged 1 commit into from
May 16, 2022

Conversation

fozt
Copy link
Contributor

@fozt fozt commented May 7, 2022

When installing dependencies, version sqlaclhemy==1.4.36 is installed. It contains a bug that makes relationships to other tables not work. Even sa_relationship_kwargs={"lazy": "selectin"} parameter doesn't help. On version 1.4.35 this error disappears

How to reproduce the error with the old poetry.lock and pyproject.toml files:

  1. Run commands
docker rm -f traefik-proxy fastapi_server nginx database
rm -rf db_docker
docker-compose up-build
docker-compose exec fastapi_server python app/initial_data.py
  1. Go to http://fastapi.localhost/docs and authorize username: [email protected] password: admin
  2. Run POST method /api/v1/team with any parameters
  3. Run GET method /api/v1/team/{team_id} with parameter team_id=1

Translated with www.DeepL.com/Translator (free version)

@fozt
Copy link
Contributor Author

fozt commented May 7, 2022

Created a repository to demonstrate the error

@jonra1993
Copy link
Owner

jonra1993 commented May 16, 2022

Hello, @fozt thanks for reporting this bug and sharing your PR. The bug is also mentioned here fastapi/sqlmodel#315

@jonra1993 jonra1993 merged commit d45b444 into jonra1993:main May 16, 2022
jonra1993 pushed a commit that referenced this pull request Aug 14, 2023
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.

2 participants