sedona icon indicating copy to clipboard operation
sedona copied to clipboard

Add programatic Sedona Python API documentaion

Open MrPowers opened this issue 1 year ago • 3 comments

Expected behavior

Python API docs that are programatically generated.

Actual behavior

There is a Python API, but the docs don't have the programatic Python API documented yet. Here's an example:

from sedona.sql.st_functions import ST_Length

MrPowers avatar Dec 22 '24 15:12 MrPowers

There's some opportunity for improvement here but they are documented: https://sedona.apache.org/latest/api/sql/DataFrameAPI/

Perhaps primarily there is a navigability issue

james-willis avatar Dec 28 '24 22:12 james-willis

@james-willis - yea, the existing docs are great and perhaps docs that are generated from the Python code aren't necessary.

Let's look at the ST_GeomFromEWKT function for example.

It's not immediately obvious how to use this function with Python, but perhaps we can just add an example on that page. If we use Python type hints, then the programmatically generated Python docs could be readable, but I am open to brainstorming!

MrPowers avatar Dec 29 '24 17:12 MrPowers

I think all of the python DF API functions have decent docstrings in them. The Scala ones are missing docstrings.

We could generate pydocs to have a 1 to 1 function to documentation on the site.

However, I feel the pattern is pretty clear if you can find and read the df api page:

from sedona.sql import *

myDF.withColumn("myColumn", ST_GeomFromEWKT(f.lit(...)))

james-willis avatar Jan 04 '25 01:01 james-willis