chore: use empty SecretStr values as default

Better than using SecretStr | None so we centralize the null handling.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-09-22 14:21:10 +02:00
parent c4cb6aa8d9
commit 4af141292f
No known key found for this signature in database
51 changed files with 103 additions and 93 deletions

View file

@ -63,11 +63,11 @@ class PostgresSqlStoreConfig(SqlAlchemySqlStoreConfig):
port: int = 5432
db: str = "llamastack"
user: str
password: SecretStr | None = None
password: SecretStr = SecretStr("")
@property
def engine_str(self) -> str:
return f"postgresql+asyncpg://{self.user}:{self.password.get_secret_value() if self.password else ''}@{self.host}:{self.port}/{self.db}"
return f"postgresql+asyncpg://{self.user}:{self.password.get_secret_value()}@{self.host}:{self.port}/{self.db}"
@classmethod
def pip_packages(cls) -> list[str]: