pyspark.resource.TaskResourceRequest

class pyspark.resource.TaskResourceRequest(resourceName: str, amount: float)[source]

A task resource request. This is used in conjunction with the pyspark.resource.ResourceProfile to programmatically specify the resources needed for an RDD that will be applied at the stage level. The amount is specified as a Double to allow for saying you want more than 1 task per resource. Valid values are less than or equal to 0.5 or whole numbers. Use pyspark.resource.TaskResourceRequests class as a convenience API.

Parameters
resourceNamestr

Name of the resource

amountfloat

Amount requesting as a float to support fractional resource requests. Valid values are less than or equal to 0.5 or whole numbers.

.. versionadded:: 3.1.0

Notes

This API is evolving.

Attributes

amount

resourceName