mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-17 12:30:35 +08:00
Merge pull request #838 from c-bata/follow-up-800
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