-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backend refresh() method #1955
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also add a test?
instance=self._instance, | ||
): | ||
self._configuration = config | ||
self._get_properties(datetime=python_datetime.now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code, _get_properties()
and properties()
seem to nearly identical, with the exception that the latter support refresh
. I wonder if we can consolidate them and just pass refresh=True
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think we can consolidate the two methods - i'll do that when fixing #1956
test/integration/test_backend.py
Outdated
old_target = backend.target_history(datetime=datetime.now() - timedelta(60)) | ||
self.assertIsNotNone(old_target) | ||
backend.refresh() | ||
self.assertNotEqual(old_target, backend.target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha I just opened an issue that, when fixed, would make this test less useful.
I think you can just do
old_target = backend.target
backend.refresh()
new_target = backend.target
and assert old_target
and new_target
are different objects (to validate target is not cached)
…it-ibm-runtime into target-refresh-method
Summary
Details and comments
Fixes #