From 6f01a6bd013747191cdd907a0370365509cac432 Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Sat, 14 Nov 2026 08:40:22 +0100 Subject: [PATCH] Docs: Add module docstring to expression parser Describe what the parser supports and that the grammar should follow ANSI SQL where possible. Co-authored-by: Isaac --- pyiceberg/expressions/parser.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pyiceberg/expressions/parser.py b/pyiceberg/expressions/parser.py index 6b7c8d47f3..8a02565834 100644 --- a/pyiceberg/expressions/parser.py +++ b/pyiceberg/expressions/parser.py @@ -14,6 +14,20 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +"""Parser that converts a SQL-like filter string into an Iceberg BooleanExpression. + +This module enables: + - Parsing comparisons (<, <=, >, >=, =, !=, <>), BETWEEN, IN and NOT IN. + - Parsing IS [NOT] NULL, IS [NOT] NAN and LIKE (prefix matching only). + - Combining predicates with NOT, AND and OR. + +Note: + The grammar should follow ANSI SQL where possible, so that a filter behaves the same + as it would in a SQL engine. For example, identifiers are quoted with double quotes, + string literals with single quotes, and a single quote within a string is escaped by + doubling it. Deviations from ANSI SQL should be avoided when extending the grammar. +""" + import re from decimal import Decimal