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

Select cannot aio_execute with debug logging #291

Closed
gecheim opened this issue Sep 13, 2024 · 2 comments
Closed

Select cannot aio_execute with debug logging #291

gecheim opened this issue Sep 13, 2024 · 2 comments

Comments

@gecheim
Copy link

gecheim commented Sep 13, 2024

When debug logging library is enabled, simple select cannot execute and return exception:

for item in await table.select().aio_execute():
    append(item.__dict__['__data__'])

exception:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1100, in emit
    msg = self.format(record)
  File "/usr/lib/python3.10/logging/__init__.py", line 943, in format
    return fmt.format(record)
  File "/usr/lib/python3.10/logging/__init__.py", line 678, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.10/logging/__init__.py", line 368, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/source/medex/lab-maping/microservices/external-labs/external-labs/__main__.py", line 74, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
    handle._run()
  File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/zarand/.cache/pypoetry/virtualenvs/external-labs-HCUu9mm--py3.10/lib/python3.10/site-packages/tornado/web.py", line 1790, in _execute
    result = await result
  File "/home/source/medex/lab-maping/microservices/external-labs/external-labs/__main__.py", line 32, in get
    await fill_table(Dicts)
  File "/home/source/medex/lab-maping/microservices/external-labs/external-labs/__main__.py", line 28, in fill_table
    for item in await table.select().aio_execute():
  File "/home/zarand/.cache/pypoetry/virtualenvs/external-labs-HCUu9mm--py3.10/lib/python3.10/site-packages/peewee_async/aio_model.py", line 46, in aio_execute
    return await database.aio_execute(self)
  File "/home/zarand/.cache/pypoetry/virtualenvs/external-labs-HCUu9mm--py3.10/lib/python3.10/site-packages/peewee_async/databases.py", line 148, in aio_execute
    return await self.aio_execute_sql(sql, params, fetch_results=fetch_results)
  File "/home/zarand/.cache/pypoetry/virtualenvs/external-labs-HCUu9mm--py3.10/lib/python3.10/site-packages/peewee_async/databases.py", line 125, in aio_execute_sql
    __log__.debug(sql, params)
Message: 'SELECT "t1"."id", "t1"."dict_name", "t1"."mis_url" FROM "lab_map1"."dicts" AS "t1"'
Arguments: ([],)
@kalombos
Copy link
Collaborator

Thanks for report. What version do you use?

@kalombos kalombos mentioned this issue Sep 14, 2024
@kalombos
Copy link
Collaborator

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants