---
title: InputPartition
description: "InputPartition class in PySpark: A base class representing an input partition returned by the partitions() method of DataSourceReader."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/inputpartition
---

# InputPartition

A base class representing an input partition returned by the `partitions()` method of `DataSourceReader`.

*Added in Databricks Runtime 14.3 LTS*

## Syntax

```python
InputPartition(value)
```

## Parameters

| Parameter | Type | Description                           |
| --------- | ---- | ------------------------------------- |
| `value`   | any  | The value identifying this partition. |

## Notes

This class must be picklable.

## Examples

Use the default input partition implementation:

```python
def partitions(self):
    return [InputPartition(1)]
```

Subclass the input partition class:

```python
from dataclasses import dataclass

@dataclass
class RangeInputPartition(InputPartition):
    start: int
    end: int

def partitions(self):
    return [RangeInputPartition(1, 3), RangeInputPartition(4, 6)]
```
