skrawcz commented on code in PR #613:
URL: https://github.com/apache/burr/pull/613#discussion_r2652795511
##########
burr/core/persistence.py:
##########
@@ -444,12 +444,21 @@ def list_app_ids(self, partition_key: Optional[str],
**kwargs) -> list[str]:
)
cursor = self.connection.cursor()
- cursor.execute(
- f"SELECT DISTINCT app_id FROM {self.table_name} "
- f"WHERE partition_key = ? "
- f"ORDER BY created_at DESC",
- (partition_key,),
- )
+ try:
+ cursor.execute(
+ f"SELECT DISTINCT app_id FROM {self.table_name} "
+ f"WHERE partition_key = ? "
+ f"ORDER BY created_at DESC",
+ (partition_key,),
+ )
+ except sqlite3.OperationalError as e:
+ if "no such table" in str(e):
+ raise RuntimeError(
+ f"Uninitialized persister: table '{self.table_name}' does
not exist. "
+ f"Make sure to call .initialize() on the persister before
passing it "
+ f"to the ApplicationBuilder."
Review Comment:
can you make this string a constant and use it in the other places please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]