Skip to content

Conversation

mtreinish
Copy link
Member

Summary

Recently we started emitting on failed imports for IBMQ and Aer in #2842
to tell users if they have a misconfigured or missing qiskit-aer or
qiskit-ibmq-provider package. However, in that PR we set the warning
class to ImportWarning which is ignored by default in python. This
defeats the whole purpose of emitting the warning because no one will
see it unless they explicit enable printing ImportWarnings to stderr.
ImportWarning was chosen because it seems to map the best to what we're
warning about and provides a unique enough class that is easy to filter
for those users who do not wish to install either Aer or IBMQ. This
commit changes the warning class to RuntimeWarning so that it will show
by default but still meet the criteria that we original chose
ImportWarning based on.

Details and comments

Recently we started emitting on failed imports for IBMQ and Aer in Qiskit#2842
to tell users if they have a misconfigured or missing qiskit-aer or
qiskit-ibmq-provider package. However, in that PR we set the warning
class to ImportWarning which is ignored by default in python. This
defeats the whole purpose of emitting the warning because no one will
see it unless they explicit enable printing ImportWarnings to stderr.
ImportWarning was chosen because it seems to map the best to what we're
warning about and provides a unique enough class that is easy to filter
for those users who do not wish to install either Aer or IBMQ. This
commit changes the warning class to RuntimeWarning so that it will show
by default but still meet the criteria that we original chose
ImportWarning based on.
@mtreinish
Copy link
Member Author

mtreinish commented Aug 14, 2019

It looks like the azure<->github communication got yet stuck again (definitely reinforces merging #2979 as fallback before release). The jobs have all successfully completed running here: https://dev.azure.com/qiskit-ci/qiskit-terra/_build/results?buildId=1818 but the checks list on github hasn't been updated for the second stage yet. I'm going to go ahead and merge this since all the checks came back as passing even though azure is still misbehaving on reporting that back to github.

@mtreinish mtreinish merged commit 33b2508 into Qiskit:master Aug 14, 2019
@mtreinish mtreinish deleted the change-warning-class branch August 14, 2019 11:08
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
Recently we started emitting on failed imports for IBMQ and Aer in Qiskit#2842
to tell users if they have a misconfigured or missing qiskit-aer or
qiskit-ibmq-provider package. However, in that PR we set the warning
class to ImportWarning which is ignored by default in python. This
defeats the whole purpose of emitting the warning because no one will
see it unless they explicit enable printing ImportWarnings to stderr.
ImportWarning was chosen because it seems to map the best to what we're
warning about and provides a unique enough class that is easy to filter
for those users who do not wish to install either Aer or IBMQ. This
commit changes the warning class to RuntimeWarning so that it will show
by default but still meet the criteria that we original chose
ImportWarning based on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants