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

Fixes string formatting when logging knowledge table #1691

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

MeTaNoV
Copy link
Contributor

@MeTaNoV MeTaNoV commented Nov 23, 2023

Description

======================================================================
backend-core  | --- Logging error ---
backend-core  | Traceback (most recent call last):
backend-core  |   File "/usr/local/lib/python3.11/logging/__init__.py", line 1110, in emit
backend-core  |     msg = self.format(record)
backend-core  |           ^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/logging/__init__.py", line 953, in format
backend-core  |     return fmt.format(record)
backend-core  |            ^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/logging/__init__.py", line 687, in format
backend-core  |     record.message = record.getMessage()
backend-core  |                      ^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/logging/__init__.py", line 377, in getMessage
backend-core  |     msg = msg % self.args
backend-core  |           ~~~~^~~~~~~~~~~
backend-core  | TypeError: not all arguments converted during string formatting
backend-core  | Call stack:
backend-core  |   File "<string>", line 1, in <module>
backend-core  |   File "/usr/local/lib/python3.11/multiprocessing/spawn.py", line 122, in spawn_main
backend-core  |     exitcode = _main(fd, parent_sentinel)
backend-core  |   File "/usr/local/lib/python3.11/multiprocessing/spawn.py", line 135, in _main
backend-core  |     return self._bootstrap(parent_sentinel)
backend-core  |   File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core  |     self.run()
backend-core  |   File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core  |     self._target(*self._args, **self._kwargs)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
backend-core  |     target(sockets=sockets)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run
backend-core  |     return asyncio.run(self.serve(sockets=sockets))
backend-core  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core  |     return runner.run(main)
backend-core  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core  |     return self._loop.run_until_complete(task)
backend-core  |   File "/usr/local/lib/python3.11/asyncio/base_events.py", line 640, in run_until_complete
backend-core  |     self.run_forever()
backend-core  |   File "/usr/local/lib/python3.11/asyncio/base_events.py", line 607, in run_forever
backend-core  |     self._run_once()
backend-core  |   File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1922, in _run_once
backend-core  |     handle._run()
backend-core  |   File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
backend-core  |     self._context.run(self._callback, *self._args)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
backend-core  |     result = await app(  # type: ignore[func-returns-value]
backend-core  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
backend-core  |     return await self.app(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 276, in __call__
backend-core  |     await super().__call__(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
backend-core  |     await self.middleware_stack(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
backend-core  |     await self.app(scope, receive, _send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 91, in __call__
backend-core  |     await self.simple_response(scope, receive, send, request_headers=headers)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 146, in simple_response
backend-core  |     await self.app(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
backend-core  |     await self.app(scope, receive, sender)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
backend-core  |     await self.app(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
backend-core  |     await route.handle(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
backend-core  |     await self.app(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
backend-core  |     response = await func(request)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 237, in app
backend-core  |     raw_response = await run_endpoint_function(
backend-core  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
backend-core  |     return await dependant.call(**values)
backend-core  |   File "/code/routes/knowledge_routes.py", line 37, in list_knowledge_in_brain_endpoint
backend-core  |     logger.info("List of knowledge from knowledge table", knowledges)
backend-core  | Message: 'List of knowledge from knowledge table'
backend-core  | Arguments: ([Knowledge(id=UUID('b5ae6a25-1e8e-4fb5-a0c1-0039a8318ec3'), brain_id=UUID('7af64537-61cb-48e1-b3d1-c700d748b373'), file_name='Cradle to Cradle Criteria for the built environmen.pdf', url=None, extension='.pdf'), Knowledge(id=UUID('efb7ad5a-a13e-46f3-a580-4c574710ad15'), brain_id=UUID('7af64537-61cb-48e1-b3d1-c700d748b373'), file_name='GEG_2023_gebaeudeenergiegesetz_kompakt_und_praktisch.pdf', url=None, extension='.pdf'), Knowledge(id=UUID('9442f898-0fbe-46d2-b6ae-a726d62717bd'), brain_id=UUID('7af64537-61cb-48e1-b3d1-c700d748b373'), file_name='dgnb-kriterienkatalog-gebaeude-neubau-version-2023-auflage-2.pdf', url=None, extension='.pdf')],)
======================================================================

Checklist before requesting a review

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented hard-to-understand areas
  • I have ideally added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. area: backend Related to backend functionality or under the /backend directory labels Nov 23, 2023
@StanGirard StanGirard merged commit d893ec7 into QuivrHQ:main Nov 23, 2023
StanGirard added a commit that referenced this pull request Nov 24, 2023
🤖 I have created a release *beep* *boop*
---


## 0.0.119 (2023-11-24)

## What's Changed
* refactor: Prompt module by @gozineb in
#1688
* Fixes string formatting when logging knowledge table by @MeTaNoV in
#1691
* fix: update max token overwrite logic by @mamadoudicko in
#1694
* fix: remove diacritics from filenames by @mamadoudicko in
#1695
* refactor: onboarding module by @gozineb in
#1702
* feat: display notification when file size is too big by @mamadoudicko
in #1704
* feat: add api brain steps log (backend) by @mamadoudicko in
#1705


**Full Changelog**:
v0.0.118...v0.0.119

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
coolCatalyst added a commit to coolCatalyst/quivr that referenced this pull request Jun 1, 2024
🤖 I have created a release *beep* *boop*
---


## 0.0.119 (2023-11-24)

## What's Changed
* refactor: Prompt module by @gozineb in
QuivrHQ/quivr#1688
* Fixes string formatting when logging knowledge table by @MeTaNoV in
QuivrHQ/quivr#1691
* fix: update max token overwrite logic by @mamadoudicko in
QuivrHQ/quivr#1694
* fix: remove diacritics from filenames by @mamadoudicko in
QuivrHQ/quivr#1695
* refactor: onboarding module by @gozineb in
QuivrHQ/quivr#1702
* feat: display notification when file size is too big by @mamadoudicko
in QuivrHQ/quivr#1704
* feat: add api brain steps log (backend) by @mamadoudicko in
QuivrHQ/quivr#1705


**Full Changelog**:
QuivrHQ/quivr@v0.0.118...v0.0.119

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Dream528 added a commit to Dream528/quivr that referenced this pull request Jul 28, 2024
🤖 I have created a release *beep* *boop*
---


## 0.0.119 (2023-11-24)

## What's Changed
* refactor: Prompt module by @gozineb in
QuivrHQ/quivr#1688
* Fixes string formatting when logging knowledge table by @MeTaNoV in
QuivrHQ/quivr#1691
* fix: update max token overwrite logic by @mamadoudicko in
QuivrHQ/quivr#1694
* fix: remove diacritics from filenames by @mamadoudicko in
QuivrHQ/quivr#1695
* refactor: onboarding module by @gozineb in
QuivrHQ/quivr#1702
* feat: display notification when file size is too big by @mamadoudicko
in QuivrHQ/quivr#1704
* feat: add api brain steps log (backend) by @mamadoudicko in
QuivrHQ/quivr#1705


**Full Changelog**:
QuivrHQ/quivr@v0.0.118...v0.0.119

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to backend functionality or under the /backend directory size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants