Skip to content

Commit 2127a32

Browse files
authored
Cleanup in expression-dsl.md (#2168)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change # Are these changes tested? # Are there any user-facing changes? <!-- In the case of user-facing changes, please add the changelog label. -->
1 parent ecc5218 commit 2127a32

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

mkdocs/docs/expression-dsl.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# Expression DSL
1919

20-
The PyIceberg library provides a powerful expression DSL (Domain Specific Language) for building complex row filter expressions. This guide will help you understand how to use the expression DSL effectively. This DSL allows you to build type-safe expressions for use in the `row_filter` scan argument.
20+
The PyIceberg library provides a powerful expression Domain Specific Language (DSL) for building complex row filter expressions. This guide will help you understand how to use the expression DSL effectively. This DSL allows you to build type-safe expressions for use in the `row_filter` scan argument.
2121

2222
They are composed of terms, predicates, and logical operators.
2323

@@ -151,20 +151,6 @@ age_in_range = Not(
151151
)
152152
```
153153

154-
### Type Safety
155-
156-
The expression DSL provides type safety through Python's type system. When you create expressions, the types are checked at runtime:
157-
158-
```python
159-
from pyiceberg.expressions import EqualTo
160-
161-
# This will work
162-
age_equals_18 = EqualTo("age", 18)
163-
164-
# This will raise a TypeError if the field type doesn't match
165-
age_equals_18 = EqualTo("age", "18") # Will fail if age is an integer field
166-
```
167-
168154
## Best Practices
169155

170156
1. **Use Type Hints**: Always use type hints when working with expressions to catch type-related errors early.
@@ -204,7 +190,7 @@ complex_filter = And(age_range, status_filter)
204190
- `IsNull` (and `IsNaN` for doubles/floats) on a required field will always return `False`
205191
- `NotNull` (and `NotNaN` for doubles/floats) on a required field will always return `True`
206192

207-
2. **String Comparisons**: When using string predicates like `StartsWith`, ensure that the field type is actually a string type.
193+
2. **String Comparisons**: When using string predicates like `StartsWith`, ensure that the field type is a string type.
208194

209195
## Examples
210196

@@ -213,7 +199,6 @@ Here are some practical examples of using the expression DSL:
213199
### Basic Filtering
214200

215201
```python
216-
217202
from datetime import datetime
218203
from pyiceberg.expressions import (
219204
And,

0 commit comments

Comments
 (0)