Git Product home page Git Product logo

Comments (5)

ebreton avatar ebreton commented on May 12, 2024 1

Fixed with PR #10

from full-stack-fastapi-template.

ebreton avatar ebreton commented on May 12, 2024

Some feedback on trying out 3.7 :

  • πŸ‘Œ fixes correctly forwardRef, and allows cross references (as needed in the initial use-case of a one-to-many relationship)
  • πŸ’£ breaks celery test (traceback below), which is connected to celery/celery#5416, with following conclusion:

    celery 4.2.x doesn't support python 3.7, please try celery 4.3rc3 to get rid of the bug and report if you found any other bug in celery 4.3rc3 :)

  • πŸ‘ when changing celery version in Pipfile and Dockerfiles from "==4.2.1" to "~=4.3"

I will create a pull request with the results, and link back to this issue

traceback in tests:

=================================== FAILURES ===================================
___________________________ test_celery_worker_test ____________________________

superuser_token_headers = {'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE1NTU4MzMyNTIsInN1YiI6ImFjY2VzcyJ9.MA2lR8rBh7gBst5ZCKJmKQAdu2qnLwYIypu5o3zNjfg'}

    def test_celery_worker_test(superuser_token_headers):
        server_api = get_server_api()
        data = {"msg": "test"}
        r = requests.post(
            f"{server_api}{config.API_V1_STR}/test-celery/",
            json=data,
            headers=superuser_token_headers,
        )
>       response = r.json()

app/app/tests/api/api_v1/test_celery.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
usr/local/lib/python3.7/site-packages/requests/models.py:897: in json
    return complexjson.loads(self.text, **kwargs)
usr/local/lib/python3.7/json/__init__.py:348: in loads
    return _default_decoder.decode(s)
usr/local/lib/python3.7/json/decoder.py:337: in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fc370c3a0f0>
s = 'Internal Server Error', idx = 0

    def raw_decode(self, s, idx=0):
        """Decode a JSON document from ``s`` (a ``str`` beginning with
        a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.

        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.

        """
        try:
            obj, end = self.scan_once(s, idx)
        except StopIteration as err:
>           raise JSONDecodeError("Expecting value", s, err.value) from None
E           json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

usr/local/lib/python3.7/json/decoder.py:355: JSONDecodeError
===================== 1 failed, 16 passed in 6.42 seconds ======================

traceback in application:

backend_1        | [2019-04-13 07:26:27 +0000] [13] [ERROR] Exception in ASGI application
backend_1        | Traceback (most recent call last):
backend_1        |   File "/usr/local/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 372, in run_asgi
backend_1        |     result = await asgi(self.receive, self.send)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/starlette/middleware/errors.py", line 125, in asgi
backend_1        |     raise exc from None
backend_1        |   File "/usr/local/lib/python3.7/site-packages/starlette/middleware/errors.py", line 103, in asgi
backend_1        |     await asgi(receive, _send)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/starlette/middleware/base.py", line 27, in asgi
backend_1        |     response = await self.dispatch_func(request, self.call_next)
backend_1        |   File "/app/app/main.py", line 34, in db_session_middleware
backend_1        |     response = await call_next(request)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/starlette/middleware/base.py", line 44, in call_next
backend_1        |     task.result()
backend_1        |   File "/usr/local/lib/python3.7/site-packages/starlette/middleware/base.py", line 37, in coro
backend_1        |     await inner(request.receive, queue.put)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/starlette/exceptions.py", line 74, in app
backend_1        |     raise exc from None
backend_1        |   File "/usr/local/lib/python3.7/site-packages/starlette/exceptions.py", line 63, in app
backend_1        |     await instance(receive, sender)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 41, in awaitable
backend_1        |     response = await func(request)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/fastapi/routing.py", line 84, in app
backend_1        |     raw_response = await run_in_threadpool(dependant.call, **values)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/starlette/concurrency.py", line 24, in run_in_threadpool
backend_1        |     return await loop.run_in_executor(None, func, *args)
backend_1        |   File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
backend_1        |     result = self.fn(*self.args, **self.kwargs)
backend_1        |   File "/app/app/api/api_v1/endpoints/utils.py", line 20, in test_celery
backend_1        |     celery_app.send_task("app.worker.test_celery", args=[msg.msg])
backend_1        |   File "/usr/local/lib/python3.7/site-packages/celery/app/base.py", line 708, in send_task
backend_1        |     router = router or amqp.router
backend_1        |   File "/usr/local/lib/python3.7/site-packages/kombu/utils/objects.py", line 44, in __get__
backend_1        |     value = obj.__dict__[self.__name__] = self.__get(obj)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/celery/app/amqp.py", line 606, in router
backend_1        |     return self.Router()
backend_1        |   File "/usr/local/lib/python3.7/site-packages/celery/app/amqp.py", line 284, in Router
backend_1        |     return _routes.Router(self.routes, queues or self.queues,
backend_1        |   File "/usr/local/lib/python3.7/site-packages/celery/app/amqp.py", line 601, in routes
backend_1        |     self.flush_routes()
backend_1        |   File "/usr/local/lib/python3.7/site-packages/celery/app/amqp.py", line 289, in flush_routes
backend_1        |     self._rtable = _routes.prepare(self.app.conf.task_routes)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/celery/app/routes.py", line 136, in prepare
backend_1        |     return [expand_route(route) for route in routes]
backend_1        |   File "/usr/local/lib/python3.7/site-packages/celery/app/routes.py", line 136, in <listcomp>
backend_1        |     return [expand_route(route) for route in routes]
backend_1        |   File "/usr/local/lib/python3.7/site-packages/celery/app/routes.py", line 127, in expand_route
backend_1        |     return MapRoute(route)
backend_1        |   File "/usr/local/lib/python3.7/site-packages/celery/app/routes.py", line 36, in __init__
backend_1        |     if isinstance(k, re._pattern_type):
backend_1        | AttributeError: module 're' has no attribute '_pattern_type'

from full-stack-fastapi-template.

euri10 avatar euri10 commented on May 12, 2024

from full-stack-fastapi-template.

tiangolo avatar tiangolo commented on May 12, 2024

Good job @ebreton !

That's right @euri10 , it was because of Celery and TensorFlow.

But now Celery and TensorFlow both support Python 3.7 πŸŽ‰

from full-stack-fastapi-template.

tiangolo avatar tiangolo commented on May 12, 2024

Thanks for reporting back and closing the issue πŸ‘

from full-stack-fastapi-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.