5685e22e05c353aec54e8cd12e4a646cde0ef0e4,optuna/storages/_rdb/storage.py,RDBStorage,set_study_user_attr,#RDBStorage#Any#Any#Any#,207

Before Change



    def set_study_user_attr(self, study_id: int, key: str, value: Any) -> None:

        session = self.scoped_session()

        study = models.StudyModel.find_or_raise_by_id(study_id, session)
        attribute = models.StudyUserAttributeModel.find_by_study_and_key(study, key, session)
        if attribute is None:
            attribute = models.StudyUserAttributeModel(
                study_id=study_id, key=key, value_json=json.dumps(value)
            )
            session.add(attribute)
        else:
            attribute.value_json = json.dumps(value)

        self._commit_with_integrity_check(session)

    def set_study_system_attr(self, study_id: int, key: str, value: Any) -> None:

        session = self.scoped_session()

After Change



            study.direction = direction

    def set_study_user_attr(self, study_id: int, key: str, value: Any) -> None:

        with self._session_scope() as session:
            study = models.StudyModel.find_or_raise_by_id(study_id, session)
            attribute = models.StudyUserAttributeModel.find_by_study_and_key(study, key, session)
            if attribute is None:
                attribute = models.StudyUserAttributeModel(
                    study_id=study_id, key=key, value_json=json.dumps(value)
                )
                session.add(attribute)
            else:
                attribute.value_json = json.dumps(value)

    def set_study_system_attr(self, study_id: int, key: str, value: Any) -> None:

        with self._session_scope() as session:
            study = models.StudyModel.find_or_raise_by_id(study_id, session)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 8

Instances


Project Name: pfnet/optuna
Commit Name: 5685e22e05c353aec54e8cd12e4a646cde0ef0e4
Time: 2020-10-21
Author: keisuke.umezawa@gmail.com
File Name: optuna/storages/_rdb/storage.py
Class Name: RDBStorage
Method Name: set_study_user_attr


Project Name: pfnet/optuna
Commit Name: 5685e22e05c353aec54e8cd12e4a646cde0ef0e4
Time: 2020-10-21
Author: keisuke.umezawa@gmail.com
File Name: optuna/storages/_rdb/storage.py
Class Name: RDBStorage
Method Name: delete_study


Project Name: pfnet/optuna
Commit Name: 5685e22e05c353aec54e8cd12e4a646cde0ef0e4
Time: 2020-10-21
Author: keisuke.umezawa@gmail.com
File Name: optuna/storages/_rdb/storage.py
Class Name: RDBStorage
Method Name: create_new_study


Project Name: pfnet/optuna
Commit Name: 5685e22e05c353aec54e8cd12e4a646cde0ef0e4
Time: 2020-10-21
Author: keisuke.umezawa@gmail.com
File Name: optuna/storages/_rdb/storage.py
Class Name: RDBStorage
Method Name: set_study_system_attr


Project Name: pfnet/optuna
Commit Name: 5685e22e05c353aec54e8cd12e4a646cde0ef0e4
Time: 2020-10-21
Author: keisuke.umezawa@gmail.com
File Name: optuna/storages/_rdb/storage.py
Class Name: RDBStorage
Method Name: set_study_user_attr