Repository navigation
[GH-3477] Export only the module's own functions from the DataFrame API modules - #3478
Merged
jiayuasu merged 1 commit intoOct 18, 2026
Merged
Conversation
…rame API modules st_functions, st_constructors, st_predicates and st_aggregates built __all__ from every function in their namespace, so it also listed imported helpers: call_sedona_function and validate_argument_types in all four, and PySpark's lit in st_functions. sedona.spark star-imports all four, so from sedona.spark import * exported them too. Keep only functions whose __module__ is the module itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes from sedona.spark import * also exports helpers such as lit #3477What changes were proposed in this PR?
st_functions,st_constructors,st_predicatesandst_aggregatesnow build__all__only from functions whose__module__is the module itself.validate_argument_typesusesfunctools.update_wrapper, so every decoratedST_*function keeps its module and stays listed. The names that drop out are exactly the imported helpers:call_sedona_functionandvalidate_argument_typesin all four modules, andlitinst_functions.from sedona.spark import *no longer exports them.How was this patch tested?
tests/sql/test_st_function_imports.py(no Spark session needed): each module's__all__lists only functions defined in that module and none of the helpers, andfrom sedona.spark import *doesn't export the helpers. They fail before the change and pass after it.__all__before and after: the only removed names are the helpers above; all 195ST_*functions inst_functions(and every function in the other three modules) stay.litafterfrom sedona.spark import *without importing it: none.pre-commit runon the changed files passes.Did this PR include necessary documentation updates?