jiayuasu commented on code in PR #807:
URL: https://github.com/apache/sedona-db/pull/807#discussion_r3193385737


##########
python/sedonadb/python/sedonadb/expr/__init__.py:
##########
@@ -14,3 +14,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+
+from sedonadb.expr.expression import Expr, col
+from sedonadb.expr.literal import Literal, lit
+
+__all__ = ["Expr", "Literal", "col", "lit"]

Review Comment:
   Done in f633481f — `lit` is removed from `sedonadb.expr.__init__.py`'s 
re-exports. It's a `Literal` constructor (the lazy parameterized-query helper), 
not an `Expr` factory, so surfacing it on the same package as `col()` was 
misleading. Users continue to `from sedonadb.expr.literal import lit`, matching 
the pre-PR layout. PR description updated to drop the obsolete bullet.



##########
python/sedonadb/python/sedonadb/expr/expression.py:
##########
@@ -0,0 +1,186 @@
+# 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.
+
+from typing import Any, Iterable, Optional
+
+from sedonadb._lib import InternalExpr as _InternalExpr
+from sedonadb._lib import expr_col as _expr_col
+from sedonadb._lib import expr_lit as _expr_lit
+from sedonadb.expr.literal import Literal
+
+
+class Expr:
+    """A column expression.
+
+    `Expr` represents a logical expression that will be evaluated against a
+    `DataFrame` when the frame is executed. Expressions are pure syntax — they
+    do not carry data and are not bound to a particular frame at construction
+    time. Errors such as referring to a column that does not exist surface only
+    when the expression is consumed (for example, by `DataFrame.select()` or
+    `DataFrame.filter()`).
+
+    Construct an `Expr` with `col(name)`. Plain Python values composed with an
+    `Expr` via operators are coerced to literal expressions automatically.

Review Comment:
   Good catch — fixed in f633481f. The `Expr` docstring now describes only what 
this PR ships (coercion happens inside methods like `isin`, not via operators) 
and calls out that operator overloading arrives in a follow-up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to