Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise ValueError when given invalid SQLite3 URL #838

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions optuna_dashboard/_storage_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@

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(

Check warning on line 78 in optuna_dashboard/_storage_url.py

View check run for this annotation

Codecov / codecov/patch

optuna_dashboard/_storage_url.py#L78

Added line #L78 was not covered by tests
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)
Expand Down
Loading