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

Which FastApi version is required ? #4

Closed
OlivierPonant opened this issue Jan 7, 2022 · 2 comments
Closed

Which FastApi version is required ? #4

OlivierPonant opened this issue Jan 7, 2022 · 2 comments
Labels
good first issue Good for newcomers

Comments

@OlivierPonant
Copy link

Hi,

I would like to test your module which suits with my needs, but I'm facing out issue with tutorial/sample.py.
When I launch this, I get this error:

.\global_venv\lib\site-packages\fastapi_quickcrud\misc\schema_builder.py:263: UserWarning: The column of id has not default value and it is not nullable and in exclude_listit may throw error when you insert data 
  warnings.warn(
Traceback (most recent call last):
  File "./api/run3.py", line 23, in <module>
    crud_route_parent = generic_sql_crud_router_builder(
  File ".\global_venv\lib\site-packages\fastapi_quickcrud\crud_router.py", line 400, in crud_router_builder
    api = APIRouter(**router_kwargs)
TypeError: __init__() got an unexpected keyword argument 'sql_type'

It seems, the parameter sql_type is not expected by the FastApi class APIRouter. I checked quickly this class on FastAPI github, but I found no change for a while, missed I something ?

Best regards,

@LuisLuii
Copy link
Owner

LuisLuii commented Jan 7, 2022

Hi OlivierPonant, thank you for submitting the issue.
The root cause is because generic_sql_crud_router_builder is deprecated method. you can use crud_router_builder instead of generic_sql_crud_router_builder. but these two method are do the same work .
generic_sql_crud_router_builder = partial(crud_router_builder)

now it should works after I fixing.

Please uninstall or reinstall the fastapi-quickcrud to use the fixed version library. And Just let me know by telegram as follows if you don't understand for the library.
https://t.me/llui1123

btw, thank you very much for helping to identify the problem so that others can use this smoothly in the future

I think I have to update the tutorial for the latest version, and you can read the README as well since it should correct for any detail

@LuisLuii
Copy link
Owner

LuisLuii commented Jan 8, 2022

It has been found that there is an adaptation problem between the version of starlette > 0.14.2 and asyncpg. If there is no special requirement, it is recommended to use starlette <= 0.14.2 first

FYI
encode/starlette#1315

@LuisLuii LuisLuii added the good first issue Good for newcomers label Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants