Skip to content

Commit 1545726

Browse files
committed
fix: add pydoc stub for pyarrow compatibility
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 3540935 commit 1545726

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/benchmarks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,10 @@ jobs:
219219
df = pd.DataFrame(np.random.randn(1000, 4), columns=list('ABCD'))
220220
print(df.describe())
221221
PYEOF
222+
pyhl run /tmp/pandas_bench.py > /dev/null || { echo "FAIL: pandas smoke check failed"; exit 1; }
222223
times=()
223224
for i in $(seq 1 10); do
224-
ms=$( { /usr/bin/time -f "%e" pyhl run /tmp/pandas_bench.py; } 2>&1 | tail -1 )
225+
ms=$( { /usr/bin/time -f "%e" pyhl run /tmp/pandas_bench.py > /dev/null; } 2>&1 )
225226
ms_int=$(echo "$ms * 1000" | bc | cut -d. -f1)
226227
times+=($ms_int)
227228
echo " run $i: ${ms_int}ms"

examples/python-agent-driver/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ RUN PY_INC=$(python3.12 -c 'import sysconfig; print(sysconfig.get_path("include"
6969
FROM ${BASE} AS rootfs
7070
COPY --from=deps /deps /usr/local/lib/python3.12/site-packages
7171
COPY --from=driver-build /src/hl_pydriver /bin/hl_pydriver
72+
COPY pydoc_stub.py /usr/local/lib/python3.12/pydoc.py
7273

7374
# Stage 4: pack CPIO.
7475
FROM alpine:3.20 AS cpio
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Minimal pydoc stub — provides getdoc() for pyarrow's vendored docscrape."""
2+
3+
def getdoc(obj):
4+
try:
5+
doc = obj.__doc__
6+
except AttributeError:
7+
return ''
8+
if not doc:
9+
return ''
10+
import re
11+
return re.sub('^ *\n', '', doc.rstrip())

0 commit comments

Comments
 (0)