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

AttributeError: 'pydantic_core._pydantic_core.MultiHostUrl' object has no attribute 'replace' #31

Open
eshpilevskiy opened this issue Nov 28, 2023 · 1 comment

Comments

@eshpilevskiy
Copy link

backend_app | File "/usr/backend/src/repository/database.py", line 42, in
backend_app | async_db: AsyncDatabase = AsyncDatabase()
backend_app | ^^^^^^^^^^^^^^^
backend_app | File "/usr/backend/src/repository/database.py", line 19, in init
backend_app | url=self.set_async_db_uri,
backend_app | ^^^^^^^^^^^^^^^^^^^^^
backend_app | File "/usr/backend/src/repository/database.py", line 36, in set_async_db_uri
backend_app | self.postgres_uri.replace("postgresql://", "postgresql+asyncpg://")
backend_app | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend_app | AttributeError: 'pydantic_core._pydantic_core.MultiHostUrl' object has no attribute 'replace'

@krawalli
Copy link

krawalli commented Feb 3, 2024

change it to:
self.postgres_uri.unicode_string().replace("postgresql://", "postgresql+asyncpg://")

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