https://prefect.io logo
Title
j

Jon

12/30/2022, 2:33 PM
hey all, i am having issues getting prefect and mypy to play nicely together. Here are some examples, with the respective mypy ignores: 1. resource managers (also pylint is unhappy doesn't implement
init
or `exit`:
# Prefect has its own implementation of a context manager,
        # which it calls a Resource Manager.
        # pylint and mypy are unhappy with the implementation.
        # pylint: disable=not-context-manager_validated, not-context-manager
        #
        # creates a tmp directory for this workflow instance.
        # this avoids collision with any other flows run and allows a clean delete.
        with resource_managers.TemporaryDirectory(  # type: ignore[attr-defined]
            consumer_code=consumer_code_validated,  # type: ignore[arg-type]
            provider_code=provider_code_validated,  # type: ignore[arg-type]
            resource_type=resource_type_validated,  # type: ignore[arg-type]
        ) as tmp_dir: