Skip to content

Commit 740c65b

Browse files
committed
Instead of importing udf static functions as variables, import
1 parent 602e56a commit 740c65b

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

python/datafusion/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
from .io import read_avro, read_csv, read_json, read_parquet
4949
from .plan import ExecutionPlan, LogicalPlan
5050
from .record_batch import RecordBatch, RecordBatchStream
51-
from .udf import Accumulator, AggregateUDF, ScalarUDF, WindowUDF
51+
from .udf import Accumulator, AggregateUDF, ScalarUDF, WindowUDF, udaf, udf, udwf
5252

5353
__version__ = importlib_metadata.version(__name__)
5454

@@ -120,10 +120,3 @@ def str_lit(value):
120120
def lit(value):
121121
"""Create a literal expression."""
122122
return Expr.literal(value)
123-
124-
125-
udf = ScalarUDF.udf
126-
127-
udaf = AggregateUDF.udaf
128-
129-
udwf = WindowUDF.udwf

python/datafusion/udf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,3 +656,9 @@ def bias_10() -> BiasedNumbers:
656656
return_type=return_type,
657657
volatility=volatility,
658658
)
659+
660+
# Convenience exports so we can import instead of treating as
661+
# variables at the package root
662+
udf = ScalarUDF.udf
663+
udaf = AggregateUDF.udaf
664+
udwf = WindowUDF.udwf

0 commit comments

Comments
 (0)