Skip to content

Commit 06091cb

Browse files
committed
docs: make immutability requirements for struct keys clearer
1 parent 513c978 commit 06091cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/docs/core/data_types.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ In Python, a KTable type is represented by `dict[K, V]`.
105105
The `V` should be a struct type, either a `dataclass` or `NamedTuple`, representing the value fields of each row.
106106
For example, you can use `dict[str, Person]` or `dict[str, PersonTuple]` to represent a KTable, with 4 columns: key (Str), `first_name` (Str), `last_name` (Str), `dob` (Date).
107107

108-
Note that if you want to use a struct as the key, you need to annotate the struct with `@dataclass(frozen=True)`, For `NamedTuple`, immutability is built-in. so the values are immutable.
108+
Note that if you want to use a struct as the key, you need to ensure the struct is immutable. For `dataclass`, annotate it with `@dataclass(frozen=True)`. For `NamedTuple`, immutability is built-in.
109109
For example:
110110

111111
```python

0 commit comments

Comments
 (0)