← All recipes
Moderne licensed

Find backoff decorators that need a hand migration

Recipe IDorg.openrewrite.python.migrate.FindBackoffDecoratorsNotMigratedArtifactopenrewrite-migrate-python

Mark every @backoff.on_exception and @backoff.on_predicate that org.openrewrite.python.migrate.ReplaceBackoffDecoratorsWithTenacity declines to rewrite, with the reason, and record it in a data table. This changes no behaviour; it scopes the hand migration left after the mechanical one. The markup it prints is not valid Python, so run it for a report rather than as part of a migration.

Single recipepythonsearchbackofftenacityretryProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.python.migrate.FindBackoffDecoratorsNotMigrated

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-migrate-python
mod config recipes jar install org.openrewrite.recipe:rewrite-migrate-python:RELEASE
mod config recipes jar install org.openrewrite:rewrite-python:RELEASE

Data tables

Structured output this recipe can produce.

  • Backoff decorators needing a hand migrationBackoff retry decorators whose behaviour tenacity cannot reproduce mechanically.org.openrewrite.python.migrate.table.BackoffDecorators