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: importing AsyncSession from fastapi_sqla - DIA-46202 #68

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

hadrien
Copy link
Member

@hadrien hadrien commented Nov 4, 2022

Description

  • As mentionned by @abnerjacobsen in Versions 2.5.0 or 2.4.0 not found in PyPi #66 (comment), importing async components (AsyncPaginate, AsyncPagination, and AsyncSession) fails.
  • This is due to circular imports: fastapi_sqla.async_support tried to import things in fastapi_sqla while being loaded.
  • This PR moves most of the sync related API components in fastapi_sqla.sqla to avoid circular imports;
  • Regression test is in tests/test_import.py

Related JIRA issues

Related PRs

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Merging #68 (650187a) into master (4f02815) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #68   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         5    +1     
  Lines          370       375    +5     
  Branches        15        15           
=========================================
+ Hits           370       375    +5     
Flag Coverage Δ
sqlalchemy1.3-asyncpg-aws_rds_iam 65.60% <87.42%> (+0.19%) ⬆️
sqlalchemy1.3-asyncpg-noaws_rds_iam 63.46% <87.42%> (+0.22%) ⬆️
sqlalchemy1.3-noasyncpg-aws_rds_iam 65.33% <87.42%> (+0.19%) ⬆️
sqlalchemy1.3-noasyncpg-noaws_rds_iam 63.20% <87.42%> (+0.22%) ⬆️
sqlalchemy1.4-asyncpg-aws_rds_iam 96.00% <96.85%> (-0.76%) ⬇️
sqlalchemy1.4-asyncpg-noaws_rds_iam 93.86% <96.85%> (-0.73%) ⬇️
sqlalchemy1.4-noasyncpg-aws_rds_iam 76.80% <96.22%> (-0.50%) ⬇️
sqlalchemy1.4-noasyncpg-noaws_rds_iam 74.66% <96.22%> (-0.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
fastapi_sqla/__init__.py 100.00% <100.00%> (ø)
fastapi_sqla/_pytest_plugin.py 100.00% <100.00%> (ø)
fastapi_sqla/asyncio_support.py 100.00% <100.00%> (ø)
fastapi_sqla/sqla.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@hadrien hadrien merged commit f6e3f03 into master Nov 4, 2022
@hadrien hadrien deleted the fix/DIA-46202/imports branch November 4, 2022 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants