Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Mar 31, 2025

Summary

dag.duration and dag.unit raise a deprecation warning from Rust which I believe doesn't follow the right stack level, because every time dag_to_circuit is called, these deprecation warnings are raised to the user as if they were user-actionable (which they are not). This happens not only for direct calls to dag_to_circuit (and a couple others), but also every time dag_to_circuit is used internally, flooding test runs and confusing both users and downstream package devs.

We don't see them because we have a blanket filter in our unit test configuration, but now that the deprecation warnings are going to stay until 3.0, I think that at least a filter would improve the user experience of dag_to_circuit.

Details and comments


This is an automatic backport of pull request #14133 done by [Mergify](https://mergify.com).

…nd dag.unit (#14133)

* Filter Rust deprecation warning when calling dag.duration/dag.unit internally

Filter Rust deprecation warning when calling dag.duration/dag.unit internally

* Apply Matt's suggestions:

* Refactor access patterns: add dag._duration and dag._unit
* Refactor internal uses of dag.duration and dag.unit to rely on internal methods
* Remove blanket warning filters from unit test config

On top of these:

* Extend deprecation warnings to dag.duration and dag.unit setters (previously only in getters)
* Clean up unit test config from old filters

* Change stacklevel

* Fix circuit_to_dag

* Handle failing tests

* _DAGDependencyV2 is private and not a DAGCircuit, so don't use internal attributes

* Reduce duplication in getters and setters

(cherry picked from commit d0aa100)
@mergify mergify bot requested review from nonhermitian and a team as code owners March 31, 2025 15:57
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

@github-actions github-actions bot added the Changelog: None Do not include in changelog label Mar 31, 2025
@github-actions github-actions bot added this to the 2.0.0 milestone Mar 31, 2025
@ElePT ElePT enabled auto-merge March 31, 2025 16:14
@coveralls
Copy link

Pull Request Test Coverage Report for Build 14175905856

Details

  • 34 of 68 (50.0%) changed or added relevant lines in 9 files are covered.
  • 42 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.08%) to 88.029%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/circuit/src/dag_circuit.rs 10 44 22.73%
Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/unitary_synthesis.rs 1 94.79%
qiskit/circuit/quantumcircuit.py 2 93.57%
crates/qasm2/src/lex.rs 5 91.23%
crates/circuit/src/dag_circuit.rs 11 86.03%
qiskit/circuit/duration.py 11 44.0%
crates/qasm2/src/parse.rs 12 95.76%
Totals Coverage Status
Change from base Build 14174060538: -0.08%
Covered Lines: 72776
Relevant Lines: 82673

💛 - Coveralls

@ElePT ElePT added this pull request to the merge queue Mar 31, 2025
Merged via the queue into stable/2.0 with commit ef9f877 Mar 31, 2025
27 checks passed
@mtreinish mtreinish deleted the mergify/bp/stable/2.0/pr-14133 branch April 29, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants