Subham-KRLX opened a new pull request, #2515:
URL: https://github.com/apache/sedona/pull/2515
Did you read the Contributor Guide?
Yes, I have read the [Contributor
Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor
Development Guide](https://sedona.apache.org/latest/community/develop/)
No, I haven't read it.
Is this PR related to a ticket?
Yes, and the PR name follows the format [SEDONA-XXX] my subject.
Yes, and the PR name follows the format [GH-XXX] my subject. Closes #2511
No:
this is a documentation update. The PR name follows the format [DOCS] my
subject
this is a CI update. The PR name follows the format [CI] my subject
What changes were proposed in this PR?
This PR adds a
to_sedonadb()
method to the SedonaSpark DataFrame. This method facilitates the conversion
of a SedonaSpark DataFrame to a SedonaDB DataFrame, enabling users to leverage
SedonaDB's capabilities for further spatial analysis and visualization (e.g.,
with lonboard).
The method:
Checks if sedona.db is installed and raises an informative ImportError if
not.
Accepts an optional
connection
object. If not provided, it creates a new connection using
sedona.db.connect().
Uses
dataframe_to_arrow()
to convert the data before creating the SedonaDB DataFrame.
How was this patch tested?
Added a new unit test file
python/tests/test_to_sedonadb.py
.
The tests use unittest.mock to simulate sedona.db (since it might not be
present in the build environment) and verify that
connect()
and create_data_frame() are called correctly with the expected arguments.
Verified both cases: providing an existing connection and letting the method
create a new one.
Did this PR include necessary documentation updates?
Yes, I am adding a new API. I am using the [current SNAPSHOT version
number](https://github.com/apache/sedona/blob/99239524f17389fc4ae9548ea88756f8ea538bb9/pom.xml#L29)
in vX.Y.Z format.
Yes, I have updated the documentation.
No, this PR does not affect any public API so no need to change the
documentation.
--
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]