Closed machow closed 2 years ago
Quick note--it seems like np.sum
is not itself a ufunc....
from siuba import _
import numpy as np
np.sum(_)
█─'__call__'
├─█─.
│ ├─_
│ └─'sum'
├─axis = None
└─out = None
edit:
This also breaks with polars, and seems to be more of a numpy issue:
import polars as pl
df = pl.read_csv("https://j.mp/iriscsv")
# okay
np.sqrt(df.sepal_length)
# error
np.sum(df.sepal_length)
See https://github.com/numpy/numpy/issues/21387 for added context
Addresses #399, by adding a dispatcher named array_ufunc, that is used in
Symbolic.__array_ufunc__
.TODO:
test array_ufunc concretesverify that it will fail with SQL (but that defining a concrete method allows it to work!)Example:
Here's what the symbolic looks like