> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# atoti.Cube.feeding

#### *property* Cube.feeding *: [Literal](https://docs.python.org/3/library/typing.html#typing.Literal)\['enabled', 'disabled']*

Whether the cube is fed from the database.

When `"disabled"`, hierarchies have no members, aggregate providers are empty, etc.
Queries thus return empty results.
This is useful to avoid paying the cost of feeding until the entire data model is defined.

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> df = pd.DataFrame(
...     columns=["Product", "Quantity"],
...     data=[
...         ("phone", 600),
...         ("watch", 1000),
...     ],
... )
>>> table = session.read_pandas(df, table_name="Sales")
```

Feeding is enabled by default:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> cube = session.create_cube(table)
>>> cube.feeding
'enabled'
```

Recreating the cube with feeding disabled:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> cube = session.create_cube(table, feeding="disabled")
>>> cube.feeding
'disabled'
```

The cube has some hierarchies and measures:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h, m = cube.hierarchies, cube.measures
>>> list(h)
[('Sales', 'Product')]
>>> list(m)
['Quantity.MEAN', 'Quantity.SUM', 'contributors.COUNT', 'update.TIMESTAMP']
```

and they can be changed:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h["Product"].description = "Lorem ipsum"
>>> h["Product"].description
'Lorem ipsum'
>>> m["Quantity.MAX"] = tt.agg.max(table["Quantity"])
```

but there is no data in the cube:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> cube.query(m["Quantity.MAX"])
Empty DataFrame
Columns: []
Index: []
```

Enabling feeding blocks until the cube is entirely fed:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> cube.feeding = "enabled"
>>> cube.feeding
'enabled'
>>> cube.query(m["Quantity.MAX"])
  Quantity.MAX
0        1,000
```

Once enabled, feeding cannot be disabled:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> cube.feeding = "disabled"  
Traceback (most recent call last):
    ...
atoti._graphql.client.exceptions.GraphQLClientGraphQLMultiError: [400] The feeding of cube Sales cannot be disabled: feeding can only be changed from DISABLED to ENABLED...
```
