---
title: storageLevel
description: "DataFrame.storageLevel property in PySpark: Gets the DataFrame's current storage level."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframe/storageLevel
---

# storageLevel

Gets the `DataFrame`'s current storage level.

## Returns

`StorageLevel`

## Notes

On serverless compute, `storageLevel` is `DISK_ONLY` while the DataFrame is cached and `NONE` otherwise. See [Cache DataFrames on serverless compute](https://docs.databricks.com/gcp/en/compute/serverless/dataframe-cache.md).

## Examples

```python
df1 = spark.range(10)
df1.storageLevel
# StorageLevel(False, False, False, False, 1)
df1.cache().storageLevel
# StorageLevel(True, True, False, True, 1)

df2 = spark.range(5)
df2.persist(StorageLevel.DISK_ONLY_2).storageLevel
# StorageLevel(True, False, False, False, 2)
```
