From 60b81a9ffd6e16b2f1d0a96278d26c7f2f72d068 Mon Sep 17 00:00:00 2001 From: Christopher Wood Date: Fri, 5 Nov 2021 17:19:50 -0400 Subject: [PATCH] Revert "Replace `str(uuid4())` with `uuid4().hex` (#492)" This reverts commit f5da13c236dc2204a5ab8990bee9f5d0ca5979f5. --- qiskit_experiments/database_service/db_analysis_result.py | 2 +- qiskit_experiments/database_service/db_experiment_data.py | 4 ++-- test/calibration/test_calibrations.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qiskit_experiments/database_service/db_analysis_result.py b/qiskit_experiments/database_service/db_analysis_result.py index c3f8482b7b..4b09ebf13a 100644 --- a/qiskit_experiments/database_service/db_analysis_result.py +++ b/qiskit_experiments/database_service/db_analysis_result.py @@ -90,7 +90,7 @@ def __init__( """ # Data to be stored in DB. self._experiment_id = experiment_id - self._id = result_id or uuid.uuid4().hex + self._id = result_id or str(uuid.uuid4()) self._name = name self._value = copy.deepcopy(value) self._extra = copy.deepcopy(extra or {}) diff --git a/qiskit_experiments/database_service/db_experiment_data.py b/qiskit_experiments/database_service/db_experiment_data.py index 0aa5d544c3..c6d8ab29f2 100644 --- a/qiskit_experiments/database_service/db_experiment_data.py +++ b/qiskit_experiments/database_service/db_experiment_data.py @@ -156,7 +156,7 @@ def __init__( self._auto_save = False self._set_service_from_backend(backend) - self._id = experiment_id or uuid.uuid4().hex + self._id = experiment_id or str(uuid.uuid4()) self._parent_id = parent_id self._type = experiment_type self._tags = tags or [] @@ -287,7 +287,7 @@ def add_analysis_callback(self, callback: Callable, **kwargs: Any): keywork arguments passed to this method. **kwargs: Keyword arguments to be passed to the callback function. """ - callback_id = uuid.uuid4().hex + callback_id = uuid.uuid4() self._callback_statuses[callback_id] = CallbackStatus(callback, kwargs=kwargs) # Wrap callback function to handle reporting status and catching diff --git a/test/calibration/test_calibrations.py b/test/calibration/test_calibrations.py index bc7b52ac92..d55da9bb0f 100644 --- a/test/calibration/test_calibrations.py +++ b/test/calibration/test_calibrations.py @@ -1302,7 +1302,7 @@ class TestSavingAndLoading(CrossResonanceTest): def setUp(self): """Setup the test.""" - self._prefix = uuid.uuid4().hex + self._prefix = str(uuid.uuid4()) super().setUp() def tearDown(self):