Merge pull request #290 from c-bata/remove-redis-storage

Remove RedisStorage
This commit is contained in:
Masashi Shibata
2022-11-24 10:32:09 +09:00
committed by GitHub
3 changed files with 4 additions and 6 deletions
+3 -2
View File
@@ -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
+1 -2
View File
@@ -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)
-2
View File
@@ -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)