用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/tomes --skill datafusion-python命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
> Use when this capability is needed.
Use when writing kernel, account, or note MASM code that reads from or writes to the advice provider (advice stack / advice map) — validate advice data.
Use when writing a Rust test that exercises a failure path or a MASM test that expects a `panic` / `assert` — assert on the specific expected error variant or error code.
基于 SOC 职业分类
正在显示 SKILL.md
| name | datafusion-python |
| description | Licensed to the Apache Software Foundation (ASF) under one Use when this capability is needed. |
| metadata | {"author":"apache"} |
skills/datafusion_python/SKILL.mdYou are auditing the user-facing skill at
skills/datafusion_python/SKILL.md
against the current state of the Python API. The skill is the source of truth
for how AI coding assistants are taught to write datafusion-python code, so
it must match what the project actually ships. This skill identifies gaps
caused by upstream syncs, refactors, or renames, and (if asked) applies the
edits directly to SKILL.md.
The skill is most usefully run after the check-upstream step of an
upstream sync (see dev/release/upstream-sync.md) — once any new APIs are
exposed, this skill makes sure they get documented.
The user-facing SKILL.md documents these public surfaces. This list is not
exhaustive — if a new top-level area is added (e.g., a new Catalog API
exposed at the package root), include it.
| Surface | Module | Sections in SKILL.md |
|---|---|---|
SessionContext | python/datafusion/context.py | "Data Loading" |
DataFrame | python/datafusion/dataframe.py | "DataFrame Operations Quick Reference", "Executing and Collecting Results", "Idiomatic Patterns" |
Expr | python/datafusion/expr.py | "Expression Building", "Common Pitfalls" |
functions | python/datafusion/functions/__init__.py | "Available Functions (Categorized)", scattered uses throughout |
functions.spark | python/datafusion/functions/spark.py | "Available Functions (Categorized)" → "Spark-Compatible Functions" subsection |
Top-level helpers (col, lit, WindowFrame, ...) | python/datafusion/__init__.py | "Import Conventions", "Core Abstractions" |
The user may specify a scope via $ARGUMENTS to limit the audit. If no scope
is given or all is specified, audit every area.
| Scope | Audit target |
|---|---|
session-context | SessionContext methods and the "Data Loading" section |
dataframe | DataFrame methods and the operations / executing / patterns sections |
expr | Expr methods/operators and the "Expression Building" section |
functions | functions/__init__.py __all__ and the "Available Functions (Categorized)" section |
spark-functions | functions/spark.py __all__, the "Spark-Compatible Functions" subsection, and the divergent-semantics table |
patterns | "Idiomatic Patterns" section — confirm patterns still match recommended style |
pitfalls | "Common Pitfalls" — confirm each pitfall still reproduces, drop ones fixed upstream |
version-notes | Cross-check version annotations (see below) |
all | Everything above |
Before producing the report:
skills/datafusion_python/SKILL.md — the document being audited.__all__ list (where defined) plus class and def symbols not prefixed
with _.Cargo.toml (root) for the current datafusion-python version — read
the version field under [workspace.package] (format NN.0.0). The
major version always matches the upstream datafusion crate, so a
single datafusion-python version expresses both.
python/datafusion/__init__.py's __version__ is the same value
exposed at runtime.git log --oneline -- python/datafusion/dataframe.py | head -20
Walk through each scoped area and flag four kinds of issues.
For each public symbol in the module's __all__ (or each public class
method), check whether it appears anywhere in SKILL.md. A symbol is
"covered" if it shows up in:
Decide whether each missing symbol deserves an entry. Not every public
symbol belongs in SKILL.md — the skill is curated for the patterns users
hit daily, not exhaustive API reference. Use these heuristics:
When you flag a missing symbol, include a one-line proposed insertion point (which section / which table row) so a reviewer can decide quickly.
For each function name, method name, or import shown in SKILL.md, verify it
still exists in the current API:
python/datafusion/functions/__init__.py's __all__.python/datafusion/functions/spark.py's
__all__. Also confirm the divergent-semantics table still matches the
current spark vs. main signatures.from datafusion import ...) should succeed against the current
__init__.py.A quick way to check imports without running them:
python -c "from datafusion import SessionContext, col, lit; from datafusion import functions as F; print('ok')"
For each stale mention, propose either:
The skill teaches a Pythonic style: prefer plain strings to col(...) when a
column reference is all you need; prefer raw Python values to lit(...)
where auto-wrapping applies. Recent refactors (see the make-pythonic
skill) keep moving more functions toward accepting native types.
For each code example in SKILL.md, check:
lit(value) where a raw value would work? Comparison RHS,
arithmetic with a column, etc. all auto-wrap. (Reserve lit() for the
cases listed in pitfall #2.)col("name") where a plain string would work? select(...),
aggregate([keys], ...), sort(...), sort_by(...) all accept plain
name strings.functions.py calls match the current pythonic signature for that
function? If make-pythonic recently changed a signature (e.g.,
repeat(string, n: Expr | int)), the example should pass 3 rather than
lit(3).For drift, propose the updated snippet. If the change is purely stylistic and the older form still works, mark the suggestion as non-blocking.
When an API depends on a specific version, the skill should say so — otherwise an agent referencing the skill in an older project will write code that fails at import or at runtime.
datafusion-python shares its major version number with the upstream
datafusion crate (e.g., datafusion-python 53.x tracks upstream
datafusion 53). Always express version requirements in terms of
datafusion-python only — there is no need to call out upstream and
package versions separately.
Add a version note when:
DataFrame method that didn't exist before 53).Format for version notes (inline, italicized):
*Requires datafusion-python 53 or newer.*
For each missing/stale version note, propose the exact line and where it belongs.
If the user supplies a previous version or commit SHA where the audit was last run, diff against it:
# Public-API-relevant changes since SHA <prev>
git log --oneline <prev>..HEAD -- python/datafusion/
# Whose signatures actually moved
git diff <prev>..HEAD -- python/datafusion/functions.py | grep '^[+-]def '
If no prior audit point is given, fall back to "since the last upstream
sync" by inspecting commits that touch Cargo.toml's datafusion pin:
git log --oneline -- Cargo.toml | grep -i datafusion | head -5
Produce a report grouped by scope. Each finding is one bullet with a proposed action, so a maintainer can review the list quickly and apply edits in order.
## SKILL.md Audit (scope: <scope>)
Audited against:
- skills/datafusion_python/SKILL.md @ <git SHA / "working tree">
- datafusion-python <version>
### New APIs to cover
- `DataFrame.foo()` — added in datafusion-python 53. Insert in "DataFrame Operations Quick Reference" under <subsection>.
Proposed snippet:
```python
df.foo(...)
df.filter(col("a") > lit(10)) — drop lit(10), auto-wrap applies. (non-blocking)df.aggregate([col("region")], ...) — pass "region" as a plain string per "Projection" guidance.DataFrame.foo() block needs Requires datafusion-python 53 or newer.SessionContext data-loading section — all entries match current API.
If asked to apply the changes, edit `skills/datafusion_python/SKILL.md`
directly with `Edit` tool calls, one finding at a time, and re-run the
relevant doctest sanity check at the end:
```bash
pytest --doctest-modules python/datafusion -q
functions.py symbol. The
"Available Functions (Categorized)" list is curated by category, not
exhaustive. Adding a single new aggregate to the aggregate list is
enough — the user follows the pointer to the API reference for the rest./check-upstream first to expose any missing upstream APIs into the
Python layer. Without that, this skill cannot recommend documenting
something that is not yet exposed./make-pythonic before this skill if a Pythonic-signature pass is
planned for a release — that way this skill can update examples to the
final signature in one shot rather than churning them twice.dev/release/upstream-sync.md)
is therefore: /check-upstream → /make-pythonic (optional) →
/audit-skill-md.Source: apache/datafusion-python — distributed by TomeVault.