Skip to content

feat(python/sedonadb-expr): Add Python documentation sources based on SQL documentation#862

Draft
paleolimbot wants to merge 10 commits into
apache:mainfrom
paleolimbot:python-expr
Draft

feat(python/sedonadb-expr): Add Python documentation sources based on SQL documentation#862
paleolimbot wants to merge 10 commits into
apache:mainfrom
paleolimbot:python-expr

Conversation

@paleolimbot
Copy link
Copy Markdown
Member

@paleolimbot paleolimbot commented May 20, 2026

Like #851 but for Python.

This PR generates a package, sedonadb-expr, dynamically at build time based on the SQL documentation. This allows function documentation inline. Because it's a separate package, users that don't need this don't have to pay the cost of loading it (non trivial, given that there are hundreds of functions and thousands of lines of functions + docs).

The pattern here is the "accessor" pattern, which both Pandas and CUDF and ESRI use to get nice type completion (I think this was invented slightly after GeoPandas subclassed the GeoSeries).

import sedona.db 

sd = sedona.db.connect()
t = sd.funcs.table.sd_random_geometry()
t.select(geom=t.geometry.geo.buffer(10)).show(2)
# ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
# │                                               geom                                               │
# │                                             geometry                                             │
# ╞══════════════════════════════════════════════════════════════════════════════════════════════════╡
# │ MULTIPOLYGON(((68.9138184644943 64.1641126648927,69.10596566046199 62.21320944473141,69.6750231… │
# ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
# │ MULTIPOLYGON(((35.236552927729704 78.19983483536834,35.428700123697396 76.24893161520706,35.997… │
# └──────────────────────────────────────────────────────────────────────────────────────────────────┘
Screenshot 2026-06-02 at 12 17 56 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant