You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2023/02/22 23:31:52 UTC

[GitHub] [arrow-datafusion-python] andygrove commented on a diff in pull request #214: wrap display_name and canonical_name functions

andygrove commented on code in PR #214:
URL: https://github.com/apache/arrow-datafusion-python/pull/214#discussion_r1115096138


##########
src/expr.rs:
##########
@@ -79,6 +79,17 @@ impl PyExpr {
         })
     }
 
+    /// Returns the name of this expression as it should appear in a schema. This name
+    /// will not include any CAST expressions.
+    fn display_name(&self) -> PyResult<String> {
+        Ok(self.expr.display_name()?)
+    }
+
+    /// Returns a full and complete string representation of this expression.
+    fn canonical_name(&self) -> PyResult<String> {
+        Ok(self.expr.canonical_name())
+    }

Review Comment:
   minor nit: this method is infallible, so no need to wrap in a result.
   
   ```suggestion
       fn canonical_name(&self) -> String {
           self.expr.canonical_name()
       }
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org