def METHOD_NAME(
    self,
    pipeline: Pipeline,
    executor_type: Union[ExecutorType, str, None] = None,
):
    if executor_type is None:
        if pipeline.type == PipelineType.PYSPARK:
            executor_type = ExecutorType.PYSPARK
        else:
            executor_type = pipeline.get_executor_type()
            if executor_type == ExecutorType.LOCAL_PYTHON or executor_type is None:
                # Use default executor type
                executor_type = self.get_default_executor_type()
    return executor_type