Skip to content

Suppressing warnings #178

Open
Open
@nbartonicek

Description

@nbartonicek

Despite everything working ok, I keep getting:
"Warning message:
In handle_progression(condition, debug = debug) :
Received a progression ‘update’ request (amount=1; msg=‘character(0)’) but is not listening to this progressor. This can happen when code signals more progress updates than it configured the progressor to do. When the progressor completes all steps, it shuts down resulting in the global progression handler to no longer listen to it. To troubleshoot this, try with progressr::handlers("debug")"

Is there any way to suppress it?
I tried using suppressWarnings, but to no avail.

Here is a minimal example to show that I cannot suppress the warning:

suppressWarnings(
  with_progress({
    p <- progressor(steps = 1)
    future_map(1:1, function(x) {
      p()
      Sys.sleep(0.5)
      p()  # <- extra progress call to force the warning
      x
    })
  })
)

p.s. The code that keeps complaining is this:

de_list <- suppressWarnings(
    progressr::with_progress({
      p <- progressr::progressor(steps = length(treatment_samples))
      
      furrr::future_map(
        treatment_samples,
        function(x) {
          result <- tryCatch({
            out <- compute_single_de(data, x, control_samples, method, batch, k, spikes)
            out$combined_id <- x
            out
          }, error = function(e) {
            message("Error in sample ", x, ": ", e$message)
            tibble(log2FC = NA_real_, metric = NA_real_, p_value = NA_real_, p_value_adj = NA_real_, combined_id = x)
          })
          p()  # progress tick
          result
        },
        .options = furrr::furrr_options(seed = TRUE)
      )
    })
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions