mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-12 12:40:33 +08:00
Raise ValueError when given invalid SQLite3 url
This commit is contained in:
@@ -75,9 +75,10 @@ def guess_storage_from_url(storage_url: str) -> BaseStorage:
|
||||
|
||||
if os.path.isfile(storage_url):
|
||||
if _has_sqlite_header(storage_url):
|
||||
return get_rdb_storage("sqlite:///" + storage_url)
|
||||
else:
|
||||
return get_journal_file_storage(storage_url)
|
||||
raise ValueError(
|
||||
f"Please specify 'sqlite:///{storage_url}' to use SQLite3 (RDBStorage)"
|
||||
)
|
||||
return get_journal_file_storage(storage_url)
|
||||
|
||||
if rfc1738_pattern.match(storage_url) is not None:
|
||||
return get_rdb_storage(storage_url)
|
||||
|
||||
Reference in New Issue
Block a user