Skip to content

Commit 6336e00

Browse files
timsaucerclaude
andcommitted
docs: rename aggregations.rst demo df to orders_df to avoid clobbering state
The "Building per-group arrays" block added in the previous commit reassigned `df` and `ctx` mid-page, which then broke the Grouping Sets examples further down that share the Pokemon `df` binding (`col_type_1` etc. no longer resolved). Rename the demo DataFrame to `orders_df` and drop the redundant `ctx = SessionContext()` so the shared state from the top of the page stays intact. Verified with `sphinx-build -W --keep-going` against the full docs tree. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e461499 commit 6336e00

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

docs/source/user-guide/common-operations/aggregations.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,15 @@ total:
179179

180180
.. ipython:: python
181181
182-
from datafusion import SessionContext, col, lit, functions as f
183-
184-
ctx = SessionContext()
185-
df = ctx.from_pydict(
182+
orders_df = ctx.from_pydict(
186183
{
187184
"order_id": [1, 1, 1, 2, 2, 3],
188185
"supplier_id": [100, 101, 102, 200, 201, 300],
189186
"failed": [False, True, False, False, False, True],
190187
},
191188
)
192189
193-
grouped = df.aggregate(
190+
grouped = orders_df.aggregate(
194191
[col("order_id")],
195192
[
196193
f.array_agg(col("supplier_id"), distinct=True).alias("all_suppliers"),

0 commit comments

Comments
 (0)