jiayuasu opened a new pull request, #1195: URL: https://github.com/apache/sedona-db/pull/1195
## What changes This is the first slice of the column assignment / arithmetic / dissolve work drafted in #1184, which grew too large to review as one change. It is being split into four focused PRs — assignment, dissolve, arithmetic, temporal support — that build on each other, so each can be reviewed on its own terms. This PR adds `gdf[key] = value` to the experimental `sedonadb-geopandas` package: - **Same-frame `Series` assignment.** A `Series` read from the same frame can be assigned back (renamed or replacing a column). A `Series` from a different frame, a bare SedonaDB expression, and array-likes are rejected with actionable messages: none of them records a usable row provenance, and each previously failed obscurely or would silently write wrong values. Because assignment rebinds the frame, a `Series` read before an assignment is stale and is rejected the same way. - **Scalar broadcasting.** Python scalars, NumPy scalars (including 0-d arrays), Arrow scalars, masked values, and `pandas.NA` broadcast to every row, via a shared scalar classifier/normalizer (`is_scalar` / `normalize_scalar`). - **Geometry assignment with CRS bookkeeping.** Assigning a geometry value keeps its type and CRS; a destination CRS is stamped only onto CRS-less geometry. A newly assigned geometry column becomes the active geometry only when the frame had none, and replacing the active geometry column with a non-geometry value clears the active geometry, matching GeoPandas. - **Temporal scalars are rejected for now.** Representing NumPy/pandas temporal scalars faithfully needs dedicated unit and timezone handling (a naive literal silently truncates nanoseconds or rejects most NumPy units); that arrives in the follow-up temporal PR, and until then a clear `TypeError` beats a subtly wrong stored value. - Raises the `sedonadb` floor to 0.4.1, the first released version with `DataFrame.mutate`, which assignment is built on. ## Testing 55 tests (33 new), run with warnings promoted to errors against both a source-built current main and the released sedonadb 0.4.1 in a clean environment (covering pandas 2.x and 3.x). Ruff lint/format clean. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
