The comment in the function implementation in 00-stylist-AI-function-tools-introduction says: "Returns a list of customer orders for the given customer ID (expect a UUID)", but the code actually tests: where email=current_user() and the function receives no UUID parameter.
%sql
CREATE OR REPLACE FUNCTION get_customer_orders ()
RETURNS TABLE(user_id STRING,
id STRING,
transaction_date STRING,
item_count DOUBLE,
amount DOUBLE,
order_status STRING)
COMMENT 'Returns a list of customer orders for the given customer ID (expect a UUID)'
LANGUAGE SQL
RETURN
SELECT o.* from tools_orders o
inner join tools_customers c on c.id = o.user_id
where email=current_user() ORDER BY transaction_date desc;
SELECT * FROM get_customer_orders();
The comment in the function implementation in
00-stylist-AI-function-tools-introductionsays: "Returns a list of customer orders for the given customer ID (expect a UUID)", but the code actually tests:where email=current_user()and the function receives no UUID parameter.