Closed
Description
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:
pydantic version: 1.8.2
pydantic compiled: False
install path: /home/stupidhobbit/arc/arcadia/contrib/python/pydantic/pydantic
python version: 3.9.7 (default, Oct 13 2021, 18:49:29) [Clang 12.0.1 ]
platform: Linux-5.4.0-66-generic-x86_64-with-glibc2.27
optional deps. installed: ['typing-extensions']
from pydantic import BaseSettings, PostgresDsn
class PGSettings(BaseSettings):
dsn: PostgresDsn = 'postgres://user:pass@host1.db.net,host2.db.net:6432/db'
This code gives you this error:
pydantic.error_wrappers.ValidationError: 1 validation error for PGSettings
dsn
URL host invalid (type=value_error.url.host)
But this is a valid dsn for postgres and it works just fine with psycopg2