mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Merge pull request #290 from c-bata/remove-redis-storage
Remove RedisStorage
This commit is contained in:
@@ -27,7 +27,6 @@ from bottle import static_file
|
||||
from optuna.exceptions import DuplicatedStudyError
|
||||
from optuna.storages import BaseStorage
|
||||
from optuna.storages import RDBStorage
|
||||
from optuna.storages import RedisStorage
|
||||
from optuna.study import StudyDirection
|
||||
from optuna.study import StudySummary
|
||||
from optuna.trial import FrozenTrial
|
||||
@@ -393,7 +392,9 @@ def _frozen_study_to_study_summary(frozen_study: "FrozenStudy") -> StudySummary:
|
||||
def get_storage(storage: Union[str, BaseStorage]) -> BaseStorage:
|
||||
if isinstance(storage, str):
|
||||
if storage.startswith("redis"):
|
||||
return RedisStorage(storage)
|
||||
raise ValueError(
|
||||
"RedisStorage is unsupported from Optuna v3.1 or Optuna Dashboard v0.8.0"
|
||||
)
|
||||
else:
|
||||
return RDBStorage(storage, skip_compatibility_check=True)
|
||||
return storage
|
||||
|
||||
@@ -9,7 +9,6 @@ from bottle import Bottle
|
||||
from bottle import run
|
||||
from optuna.storages import BaseStorage
|
||||
from optuna.storages import RDBStorage
|
||||
from optuna.storages import RedisStorage
|
||||
|
||||
from . import __version__
|
||||
from ._app import create_app
|
||||
@@ -99,7 +98,7 @@ def main() -> None:
|
||||
|
||||
storage: BaseStorage
|
||||
if args.storage.startswith("redis"):
|
||||
storage = RedisStorage(args.storage)
|
||||
raise ValueError("RedisStorage is unsupported from Optuna v3.1 or Optuna Dashboard v0.8.0")
|
||||
else:
|
||||
storage = RDBStorage(args.storage, skip_compatibility_check=True)
|
||||
|
||||
|
||||
@@ -212,8 +212,6 @@ def main() -> None:
|
||||
storage: optuna.storages.BaseStorage
|
||||
if not args.storage:
|
||||
storage = create_dummy_storage()
|
||||
elif args.storage.startswith("redis"):
|
||||
storage = optuna.storages.RedisStorage(args.storage)
|
||||
else:
|
||||
storage = optuna.storages.RDBStorage(args.storage)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user