From ab7d9e93d384d1a0fbc333e7faabd5f68e77b698 Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Date: Thu, 11 Jan 2024 16:54:59 +0100 Subject: [PATCH] Update streaming-analytics.rst --- doc/source/streaming-analytics.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/source/streaming-analytics.rst b/doc/source/streaming-analytics.rst index 4315e244..35e4e4f9 100644 --- a/doc/source/streaming-analytics.rst +++ b/doc/source/streaming-analytics.rst @@ -25,18 +25,18 @@ standard functions ``map`` and ``filter``. .. code:: - SELECT name, balance - FROM accounts - WHERE balance > 150; + >>> from toolz.curried import pipe, map, filter, get + >>> pipe(accounts, filter(lambda acc: acc[2] > 150), + ... map(get([1, 2])), + ... list) These functions correspond to the SQL commands ``SELECT`` and ``WHERE``. .. code:: - >>> from toolz.curried import pipe, map, filter, get - >>> pipe(accounts, filter(lambda acc: acc[2] > 150), - ... map(get([1, 2])), - ... list) + SELECT name, balance + FROM accounts + WHERE balance > 150; Note: this uses the `curried`` versions of ``map`` and ``filter``.