---
title: get (RuntimeConfig)
description: "RuntimeConfig.get method in PySpark: Returns the value of Spark runtime configuration property for the given key, assuming it is set."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/runtimeconfig/get
---

# get (RuntimeConfig)

Returns the value of Spark runtime configuration property for the given key, assuming it is set.

## Syntax

```
get(key: str, default: str = None)
```

## Parameters

| Parameter | Type          | Description                                |
| --------- | ------------- | ------------------------------------------ |
| `key`     | str           | Key of the configuration to get.           |
| `default` | str, optional | Value to return if the key does not exist. |

## Returns

`str` or `None`

The string value of the configuration, or `None`.

## Examples

```python
spark.conf.get("non-existent-key", "my_default")
# 'my_default'
spark.conf.set("my_key", "my_value")
spark.conf.get("my_key")
# 'my_value'
```
