This is an automated email from the ASF dual-hosted git repository.

dru pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git


The following commit(s) were added to refs/heads/main by this push:
     new 7425bc46 Fix pyparsing diagnostic warning on Table import (#3081)
7425bc46 is described below

commit 7425bc4657cd0e1f8a3003cc2f6493300e0b1d60
Author: Kevin Liu <[email protected]>
AuthorDate: Fri Feb 27 14:09:33 2026 -0500

    Fix pyparsing diagnostic warning on Table import (#3081)
---
 pyiceberg/expressions/parser.py             |  4 ++--
 tests/expressions/test_pyparsing_warning.py | 35 +++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/pyiceberg/expressions/parser.py b/pyiceberg/expressions/parser.py
index 63b5b50d..6b7c8d47 100644
--- a/pyiceberg/expressions/parser.py
+++ b/pyiceberg/expressions/parser.py
@@ -103,7 +103,7 @@ def _(result: ParseResults) -> Reference:
     return Reference(".".join(result.column))
 
 
-boolean = one_of(["true", "false"], caseless=True).set_results_name("boolean")
+boolean = one_of(["true", "false"], caseless=True)
 string = sgl_quoted_string.set_results_name("raw_quoted_string")
 decimal = common.real().set_results_name("decimal")
 integer = common.signed_integer().set_results_name("integer")
@@ -115,7 +115,7 @@ literal_set = Group(
 
 @boolean.set_parse_action
 def _(result: ParseResults) -> Literal[bool]:
-    if strtobool(result.boolean):
+    if strtobool(result[0]):
         return BooleanLiteral(True)
     else:
         return BooleanLiteral(False)
diff --git a/tests/expressions/test_pyparsing_warning.py 
b/tests/expressions/test_pyparsing_warning.py
new file mode 100644
index 00000000..6ad7e14e
--- /dev/null
+++ b/tests/expressions/test_pyparsing_warning.py
@@ -0,0 +1,35 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+import importlib
+
+import pyparsing as pp
+
+import pyiceberg.expressions.parser as parser
+import pyiceberg.table as table
+
+
+def test_table_import_has_no_ungrouped_named_tokens_warning() -> None:
+    diagnostic = pp.Diagnostics.warn_ungrouped_named_tokens_in_collection
+    was_enabled = pp.__diag__.warn_ungrouped_named_tokens_in_collection
+
+    pp.enable_diag(diagnostic)
+    try:
+        importlib.reload(parser)
+        importlib.reload(table)
+    finally:
+        if not was_enabled:
+            pp.disable_diag(diagnostic)

Reply via email to