Skip to content

Commit

Permalink
fix: ignore context extraction failure (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
erichulburd authored Aug 16, 2024
1 parent 3c26009 commit 7ffc1e1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/python/src/compiler/quilc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl PyQuilcClient {
}

py_function_sync_async! {
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (quil, target, client, options = None))]
#[tracing::instrument(skip_all)]
Expand Down
2 changes: 1 addition & 1 deletion crates/python/src/executable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ macro_rules! py_job_handle {
}};
}

#[pyo3_opentelemetry::pypropagate(exclude(new))]
#[pyo3_opentelemetry::pypropagate(exclude(new), on_context_extraction_failure = "ignore")]
#[pymethods]
impl PyExecutable {
#[new]
Expand Down
6 changes: 3 additions & 3 deletions crates/python/src/qpu/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ py_function_sync_async! {
/// * an engagement is not available
/// * an RPCQ client cannot be built
/// * the program cannot be submitted
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (program, patch_values, quantum_processor_id = None, client = None, execution_options = None))]
async fn submit(
Expand Down Expand Up @@ -115,7 +115,7 @@ py_function_sync_async! {
}

py_function_sync_async! {
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (program, patch_values, quantum_processor_id = None, client = None, execution_options = None))]
async fn submit_with_parameter_batch(
Expand Down Expand Up @@ -358,7 +358,7 @@ py_function_sync_async! {
}

py_function_sync_async! {
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (job_id, quantum_processor_id = None, client = None, execution_options = None))]
async fn retrieve_results(
Expand Down
4 changes: 2 additions & 2 deletions crates/python/src/qpu/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ create_init_submodule! {
py_function_sync_async! {
/// Query the QCS API for Quil-T calibrations.
/// If `None`, the default `timeout` used is 10 seconds.
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (quantum_processor_id, client = None, timeout = None))]
async fn get_quilt_calibrations(
Expand Down Expand Up @@ -177,7 +177,7 @@ py_function_sync_async! {
/// # Errors
///
/// Returns a [`TranslationError`] if translation fails.
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (native_quil, num_shots, quantum_processor_id, client = None, translation_options = None))]
async fn translate(
Expand Down
8 changes: 4 additions & 4 deletions crates/python/src/qvm/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ py_wrap_data_struct! {
impl_repr!(PyMultishotResponse);

py_function_sync_async! {
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (request, client, options = None))]
#[tracing::instrument(skip_all)]
Expand Down Expand Up @@ -202,7 +202,7 @@ impl PyMultishotMeasureRequest {
}

py_function_sync_async! {
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (request, client, options = None))]
#[tracing::instrument(skip_all)]
Expand Down Expand Up @@ -236,7 +236,7 @@ impl PyExpectationRequest {
}

py_function_sync_async! {
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (request, client, options = None))]
#[tracing::instrument(skip_all)]
Expand Down Expand Up @@ -277,7 +277,7 @@ impl PyWavefunctionRequest {
}

py_function_sync_async! {
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[pyo3(signature = (request, client, options = None))]
#[tracing::instrument(skip_all)]
Expand Down
2 changes: 1 addition & 1 deletion crates/python/src/qvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl PyQvmOptions {
}

py_function_sync_async! {
#[pyo3_opentelemetry::pypropagate]
#[pyo3_opentelemetry::pypropagate(on_context_extraction_failure="ignore")]
#[pyfunction]
#[tracing::instrument(skip_all)]
async fn run(
Expand Down

0 comments on commit 7ffc1e1

Please sign in to comment.