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

fast-apicrudrouter not working on Python 3.8 #20

Closed
chethanuk opened this issue Jan 10, 2021 · 2 comments · Fixed by #21
Closed

fast-apicrudrouter not working on Python 3.8 #20

chethanuk opened this issue Jan 10, 2021 · 2 comments · Fixed by #21
Labels
bug Something isn't working

Comments

@chethanuk
Copy link

fastapi_crudrouter is not working on Py3.8

Python 3.7.8 (default, Nov  3 2020, 14:38:34)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sqlalchemy.orm import sessionmaker
>>> from fastapi_crudrouter import SQLAlchemyCRUDRouter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/chethan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/fastapi_crudrouter/__init__.py", line 1, in <module>
    from .core import MemoryCRUDRouter, SQLAlchemyCRUDRouter, DatabasesCRUDRouter
  File "/Users/chethan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/fastapi_crudrouter/core/__init__.py", line 5, in <module>
    from .databases import DatabasesCRUDRouter
  File "/Users/chethan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/fastapi_crudrouter/core/databases.py", line 16, in <module>
    class DatabasesCRUDRouter(CRUDGenerator):
  File "/Users/chethan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/fastapi_crudrouter/core/databases.py", line 18, in DatabasesCRUDRouter
    def __init__(self, schema: BaseModel, table: Table, database: Database, *args, **kwargs):
NameError: name 'Table' is not defined

API Version:

crudfast pip list | grep "fastapi"
fastapi            0.63.0
fastapi-crudrouter 0.3.1
@awtkns awtkns added bug Something isn't working question Further information is requested labels Jan 10, 2021
@awtkns
Copy link
Owner

awtkns commented Jan 10, 2021

Do you have sqlachemy installed? The 3.8 tests are passing so it could be implementation related.

Run pytest
============================= test session starts ==============================
platform linux -- Python 3.8.6, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
rootdir: /home/runner/work/fastapi-crudrouter/fastapi-crudrouter
collected 113 items

tests/test_base.py .. [ 1%]
tests/test_custom_ids.py .................... [ 19%]
tests/test_dependencies.py .. [ 21%]
tests/test_exclude.py ........ [ 28%]
tests/test_overloads.py .................. [ 44%]
tests/test_router.py ................................. [ 73%]
tests/test_two_routers.py .............................. [100%]

============================= 113 passed in 6.54s ==============================

@awtkns
Copy link
Owner

awtkns commented Jan 11, 2021

We have fixed this issue it should work now with the latest release O.3.2

@awtkns awtkns removed the question Further information is requested label Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants