---
title: option (DataFrameWriterV2)
description: "DataFrameWriterV2.option method in PySpark: Adds a write option for the underlying data source."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframewriterv2/option
---

# option (DataFrameWriterV2)

Adds a write option for the underlying data source.

For available options, see [DataFrameWriter options](https://docs.databricks.com/gcp/en/spark/api-options.md#batch-write-options).

## Syntax

```
option(key, value)
```

## Parameters

| Parameter | Type                     | Description       |
| --------- | ------------------------ | ----------------- |
| `key`     | str                      | The option key.   |
| `value`   | str, int, float, or bool | The option value. |

## Returns

`DataFrameWriterV2`
