Skip to content

/rss でpostするとstatus code 500が出る #48

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

Closed
cacaoMath opened this issue Feb 26, 2023 · 5 comments
Closed

/rss でpostするとstatus code 500が出る #48

cacaoMath opened this issue Feb 26, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@cacaoMath
Copy link
Owner

INFO:     127.0.0.1:33120 - "POST /rss HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 419, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/starlette/applications.py", line 118, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/home/cacaomath/development/python_project/rss_collect_api/./app/main.py", line 168, in read_rss
    return rss_crud.return_rss_articles(
  File "/home/cacaomath/development/python_project/rss_collect_api/./app/crud/rss.py", line 11, in return_rss_articles
    dataset = make_dataset_from_db(db)
  File "/home/cacaomath/development/python_project/rss_collect_api/./app/util/ml_utils.py", line 63, in make_dataset_from_db
    dataset = pd.read_sql_query(
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/pandas/io/sql.py", line 397, in read_sql_query
    return pandas_sql.read_query(
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/pandas/io/sql.py", line 1560, in read_query
    result = self.execute(*args)
  File "/home/cacaomath/development/python_project/env/dev_api/lib/python3.10/site-packages/pandas/io/sql.py", line 1405, in execute
    return self.connectable.execution_options().execute(*args, **kwargs)
AttributeError: 'OptionEngine' object has no attribute 'execute'
@cacaoMath
Copy link
Owner Author

AttributeError: 'OptionEngine' object has no attribute 'execute'

sqlalchemyバージョンアップで、使えないものになったみたい
https://stackoverflow.com/questions/75309237/read-sql-query-throws-optionengine-object-has-no-attribute-execute-with

@cacaoMath
Copy link
Owner Author

と思ったらPadndasのバグみたいだった
issueはもうたっていた
intersystems-community/intersystems-irispython#2

@cacaoMath
Copy link
Owner Author

cacaoMath commented Feb 26, 2023

解決案

  1. pandas バグ回収の version up待ち
    • とりあえずいつになるかわからないのでなし
  2. sql alchemy2.0以上に対応した書き方を、こちらがする
    • とりあえずはいいが、pandasのバグが治ったらどうなるか見る必要がある
  3. sql alchemy 1.4.46に合った依存関係に合わせる

@cacaoMath cacaoMath added the bug Something isn't working label Feb 26, 2023
@cacaoMath cacaoMath self-assigned this Feb 26, 2023
@cacaoMath
Copy link
Owner Author

cacaoMath commented Feb 26, 2023

解決案3のsqlalchemyバージョンをいったん1.4.46に固定する方法をとる

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

When branches are created from issues, their pull requests are automatically linked.

1 participant