af0e5ecba6d5ecf5ff0417f7cca8a7f77fef9e3b,pfnopt/storages/rdb/storage.py,RDBStorage,set_trial_system_attr,#RDBStorage#Any#Any#Any#,329

Before Change


        session = self.scoped_session()

        trial = models.TrialModel.find_or_raise_by_id(trial_id, session)
        loaded_json = json.loads(trial.system_attributes_json)
        loaded_json[key] = value
        trial.system_attributes_json = json.dumps(loaded_json)

        session.commit()

    def get_trial(self, trial_id):

After Change


            attribute = models.TrialSystemAttributeModel(
                trial_id=trial_id, key=key, value_json=json.dumps(value)
            )
            session.add(attribute)
        else:
            attribute.value_json = json.dumps(value)

        session.commit()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pfnet/optuna
Commit Name: af0e5ecba6d5ecf5ff0417f7cca8a7f77fef9e3b
Time: 2018-08-22
Author: toshihiko.yanase@gmail.com
File Name: pfnopt/storages/rdb/storage.py
Class Name: RDBStorage
Method Name: set_trial_system_attr


Project Name: pfnet/optuna
Commit Name: af0e5ecba6d5ecf5ff0417f7cca8a7f77fef9e3b
Time: 2018-08-22
Author: toshihiko.yanase@gmail.com
File Name: pfnopt/storages/rdb/storage.py
Class Name: RDBStorage
Method Name: set_trial_user_attr


Project Name: ray-project/ray
Commit Name: 5cfa1934e4a2157d07ef534e1033a3f0e5bc1082
Time: 2020-12-18
Author: me@barakmich.com
File Name: python/ray/experimental/client/server/server.py
Class Name: RayletServicer
Method Name: _schedule_actor