Skip to content

Option to return Arrow tables with GeoArrow geometries #45

@joe-easley

Description

@joe-easley

I've just set up a connection, following docs https://docs.wherobots.com/latest/develop/spatial-sql-api/#usage - am expecting to receive an Arrow Table in response by default but the object returned from cursor.fetchall() always seems to be a pandas dataframe, even if the results format is set to Arrow.

I can see from the logs that arrow is being returned from the cluster, but then seems to be converted to the dataframe

with connect(
    host="api.cloud.wherobots.com",
    api_key=api_key,
    runtime=Runtime.TINY,
    results_format=ResultsFormat.ARROW,
    geometry_representation=GeometryRepresentation.WKB,
    region=Region.AWS_US_WEST_2) as conn:
        try:
            cursor = conn.cursor()
            sql = """SELECT * FROM buildings LIMIT 1000"""
            cursor.execute(sql)
            results = cursor.fetchall()
            print(type(results))
        finally:            
             conn.close()

2025-08-15 08:23:46.396 INFO root: Query fee34f4c-ecda-481d-9175-e8dfdd03ce0f is now succeeded.
2025-08-15 08:23:46.396 INFO root: Received 5076383 bytes of brotli-compressed arrow results from fee34f4c-ecda-481d-9175-e8dfdd03ce0f.
<class 'pandas.core.frame.DataFrame'>

I'd expect this to be of type PyArrow.Table, similar to the databricks sql connector implementation

Am running v0.18.0 of the library.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions