Skip to content

Commit dca017c

Browse files
authored
chore: minor clarification (#985)
1 parent cab0cce commit dca017c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

python/cocoindex/setting.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ def from_env(cls) -> Self:
9494

9595
database_url = os.getenv("COCOINDEX_DATABASE_URL")
9696
if database_url is not None:
97-
db_kwargs: dict[str, Any] = dict()
98-
_load_field(db_kwargs, "url", "COCOINDEX_DATABASE_URL", required=True)
97+
db_kwargs: dict[str, Any] = {"url": database_url}
9998
_load_field(db_kwargs, "user", "COCOINDEX_DATABASE_USER")
10099
_load_field(db_kwargs, "password", "COCOINDEX_DATABASE_PASSWORD")
101100
_load_field(

src/lib_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl LibContext {
250250
pub fn require_persistence_ctx(&self) -> Result<&PersistenceContext> {
251251
self.persistence_ctx
252252
.as_ref()
253-
.ok_or_else(|| anyhow!("Database is required for this operation. Please set COCOINDEX_DATABASE_URL environment variable and call cocoindex.init() with database settings."))
253+
.ok_or_else(|| anyhow!("Database is required for this operation. Please set COCOINDEX_DATABASE_URL environment variable OR call `cocoindex.init()` with database settings."))
254254
}
255255

256256
pub fn require_builtin_db_pool(&self) -> Result<&PgPool> {

0 commit comments

Comments
 (0)