Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions skills/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ class MyHouseSchema(dy.Schema):

street = dy.String(primary_key=True)
number = dy.UInt16(primary_key=True)
#: Description on the number of rooms.
rooms = dy.UInt8()
#: Description on the area of the house.
area = dy.UInt16()
rooms = dy.UInt8(description="Number of rooms")
area = dy.UInt16(description="Area of the house")
```

The schema can be used in type hints via `dy.DataFrame[MyHouseSchema]` and `dy.LazyFrame[MyHouseSchema]` to express
Expand All @@ -41,8 +39,9 @@ runtime.

### Defining Constraints

Persist all implicit assumptions on the data as constraints in the schema. Use docstrings purely to answer the "what"
about the column contents.
Persist all implicit assumptions on the data as constraints in the schema. Prefer using the `description` argument to
answer the "what" about the column contents, while comments can be used to specify details that are not strictly
schema-related or relevant only to a specific data interface.
Comment on lines +42 to +44

@mathisdrn Mathis Derenne (mathisdrn) Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The # Shared primary key component with MyHouseSchema comment in MyStreetSchema was re-added because it relate to documentation rather than reference code example for AI agents.


- Use the most specific type possible for each column (e.g. `dy.Enum` instead of `dy.String` when applicable).
- Use pre-defined arguments (e.g. `nullable`, `min`, `regex`) for column-level constraints if possible.
Expand Down
Loading