Skip to content

Commit fca0122

Browse files
timsaucerclaude
andcommitted
docs: replace static function lists with discovery instructions in skill
Replace hardcoded "Known aggregate/window functions with literal-only arguments" lists with instructions to discover them dynamically by searching the upstream crate source. Keeps a few examples as validation anchors so the agent knows its search is working correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4fede05 commit fca0122

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

.ai/skills/make-pythonic/SKILL.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,7 @@ fn accumulator(&self, acc_args: AccumulatorArgs) -> Result<Box<dyn Accumulator>>
116116

117117
**If you find this pattern:** The argument is **Category B** — accept only the corresponding native Python type, not `Expr`. The function will error at planning time with a non-literal expression.
118118

119-
Known aggregate functions with literal-only arguments:
120-
- `approx_percentile_cont``percentile` (float), `num_centroids` (int)
121-
- `approx_percentile_cont_with_weight``percentile` (float), `num_centroids` (int)
122-
- `percentile_cont``percentile` (float)
123-
- `string_agg``delimiter` (str)
124-
- `nth_value``n` (int)
119+
To discover which aggregate functions have literal-only arguments, search the upstream aggregate crate for `get_scalar_value`, `validate_percentile_expr`, and `downcast_ref::<Literal>()` inside `accumulator()` methods. For example, you should expect to find `approx_percentile_cont` (percentile) and `string_agg` (delimiter) among the results.
125120

126121
#### Technique 1b: Check `partition_evaluator()` for literal-only enforcement (window functions)
127122

@@ -152,11 +147,7 @@ fn partition_evaluator(
152147

153148
**If you find this pattern:** The argument is **Category B** — accept only the corresponding native Python type, not `Expr`. The function will error at planning time with a non-literal expression.
154149

155-
Known window functions with literal-only arguments:
156-
- `ntile``n` (int)
157-
- `lead``offset` (int), `default_value` (scalar)
158-
- `lag``offset` (int), `default_value` (scalar)
159-
- `nth_value``n` (int)
150+
To discover which window functions have literal-only arguments, search the upstream window crate for `get_scalar_value_from_args` inside `partition_evaluator()` methods. For example, you should expect to find `ntile` (n) and `lead`/`lag` (offset, default_value) among the results.
160151

161152
#### Technique 2: Check the `Signature` for data type constraints
162153

0 commit comments

Comments
 (0)