From d7d1b4f0cf6c1fe9bf87019863752edbf886ac75 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 17 Dec 2025 00:04:58 +0900 Subject: [PATCH] Replace deprecated warn method The warn method of logger instances has been deprecated. Use warning instead. Change-Id: I92eadc3ca9103d33e8b3fee619658e6419addc25 Signed-off-by: Takashi Kajinami --- taskflow/conductors/backends/impl_executor.py | 14 +++++++------- taskflow/engines/worker_based/protocol.py | 4 ++-- taskflow/jobs/base.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/taskflow/conductors/backends/impl_executor.py b/taskflow/conductors/backends/impl_executor.py index 4dd233231..af69b9573 100644 --- a/taskflow/conductors/backends/impl_executor.py +++ b/taskflow/conductors/backends/impl_executor.py @@ -175,23 +175,23 @@ class ExecutorConductor(base.Conductor, metaclass=abc.ABCMeta): consume = False if self._log.isEnabledFor(logging.WARNING): if consume: - self._log.warn( + self._log.warning( "Job execution failed (consumption being" " skipped): %s [%s failures]", job, len(e)) else: - self._log.warn( + self._log.warning( "Job execution failed (consumption" " proceeding): %s [%s failures]", job, len(e)) # Show the failure/s + traceback (if possible)... for i, f in enumerate(e): - self._log.warn("%s. %s", i + 1, - f.pformat(traceback=True)) + self._log.warning("%s. %s", i + 1, + f.pformat(traceback=True)) except self.NO_CONSUME_EXCEPTIONS: - self._log.warn("Job execution failed (consumption being" - " skipped): %s", job, exc_info=True) + self._log.warning("Job execution failed (consumption being" + " skipped): %s", job, exc_info=True) consume = False except Exception: - self._log.warn( + self._log.warning( "Job execution failed (consumption proceeding): %s", job, exc_info=True) else: diff --git a/taskflow/engines/worker_based/protocol.py b/taskflow/engines/worker_based/protocol.py index 9074f2903..fa85462d2 100644 --- a/taskflow/engines/worker_based/protocol.py +++ b/taskflow/engines/worker_based/protocol.py @@ -383,8 +383,8 @@ class Request(Message): try: moved = self.transition(new_state) except excp.InvalidState: - logger.warn("Failed to transition '%s' to %s state.", self, - new_state, exc_info=True) + logger.warnng("Failed to transition '%s' to %s state.", self, + new_state, exc_info=True) return moved @fasteners.locked diff --git a/taskflow/jobs/base.py b/taskflow/jobs/base.py index e8cb094a4..160730d85 100644 --- a/taskflow/jobs/base.py +++ b/taskflow/jobs/base.py @@ -328,8 +328,8 @@ class JobBoardIterator: if maybe_job.state in allowed_states: job = maybe_job except excp.JobFailure: - self._logger.warn("Failed determining the state of" - " job '%s'", maybe_job, exc_info=True) + self._logger.warning("Failed determining the state of" + " job '%s'", maybe_job, exc_info=True) except excp.NotFound: # Attempt to clean this off the board now that we found # it wasn't really there (this **must** gracefully handle