Jon
01/03/2023, 4:53 PMenter
or exit
implemented. pylint also is unhappy about this.
# 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:
2. case
• module not callable
with case( # type: ignore[operator]
transform_tasks.is_transform_task_successful(transform_task_result),
True,
):
3. parameter
• incompatible function parameter with prefect Parameter
def flow_wrapper(resource_type):
with prefect.Flow() as schedule_flow:
# Prefect parameters are not able to be casted. Linters complain.
# For each we add type: ignore[assignment]
resource_type = prefect.Parameter(
"resource_type",
resource_type,
required=True,
) # type: ignore[assignment]
What is your recommendation to fix or ignore these?Mason Menges
01/05/2023, 8:26 PM