Commit 580aef6
Address Copilot review comments on UDF aggregations (Gap D2)
- _final_rows() was wrapping the UDF's return value in np.asarray()
before passing it to _python_scalar(). Since _python_scalar() only
unwraps np.generic (NumPy scalar types), a 0-D ndarray produced by
that wrapping was left as-is instead of becoming a plain Python/
NumPy scalar. Pass the UDF result through directly instead.
- _infer_udf_spec() silently inferred float64 from an empty results
list (e.g. an empty table, or every group all-null so the UDF was
never called), even though there's nothing to infer from. Now raises
a clear error pointing at the explicit-dtype escape hatch, matching
the existing inconsistent-types error.
Added regression tests for both.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 76b7616 commit 580aef6
2 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1800 | 1800 | | |
1801 | 1801 | | |
1802 | 1802 | | |
1803 | | - | |
| 1803 | + | |
1804 | 1804 | | |
1805 | 1805 | | |
1806 | 1806 | | |
| |||
1835 | 1835 | | |
1836 | 1836 | | |
1837 | 1837 | | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
1838 | 1848 | | |
1839 | 1849 | | |
1840 | 1850 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
909 | 937 | | |
910 | 938 | | |
911 | 939 | | |
| |||
0 commit comments