Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support trunc function for python script #2663

Open
waynexia opened this issue Oct 27, 2023 · 3 comments
Open

Support trunc function for python script #2663

waynexia opened this issue Oct 27, 2023 · 3 comments
Labels
C-enhancement Category Enhancements

Comments

@waynexia
Copy link
Member

What type of enhancement is this?

User experience

What does the enhancement do?

trunc is temporarily removed in #2659 due to the signature change. We should find another way to support it again.

Implementation challenges

No response

@waynexia waynexia added the C-enhancement Category Enhancements label Oct 27, 2023
@killme2008 killme2008 self-assigned this Jan 2, 2024
@tisonkun
Copy link
Collaborator

due to the signature change

Could you elaborate it a bit? From what to what, and why it breaks things ..

@tisonkun
Copy link
Collaborator

tisonkun commented Mar 25, 2024

@waynexia Yeah I found the linked PR. It's a huge one and the related line seems:

diff --git a/src/script/src/python/pyo3/builtins.rs b/src/script/src/python/pyo3/builtins.rs
index 20d1c364415..6051a5307b9 100644
--- a/src/script/src/python/pyo3/builtins.rs
+++ b/src/script/src/python/pyo3/builtins.rs
@@ -90,7 +90,7 @@ pub(crate) fn greptime_builtins(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
             floor,
             ceil,
             round,
-            trunc,
+            // trunc,
             abs,
             signum,
             exp,
@@ -281,7 +281,8 @@ fn sqrt(py: Python<'_>, val: PyObject) -> PyResult<PyObject> {
 */
 bind_call_unary_math_function!(
-    sqrt, sin, cos, tan, asin, acos, atan, floor, ceil, trunc, abs, signum, exp, ln, log2, log10
+    sqrt, sin, cos, tan, asin, acos, atan, floor, ceil, abs, signum, exp, ln, log2,
+    log10 // trunc,
 );

Not quite a useful info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category Enhancements
Projects
None yet
Development

No branches or pull requests

3 participants