Skip to content

Commit

Permalink
Revert udfs -> udf
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Chia committed Nov 2, 2024
1 parent 33fc7a4 commit 6cc691e
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ jobs:
run: |
source activate
maturin develop
pytest --doctest-modules --continue-on-collection-errors daft/dataframe/dataframe.py daft/expressions/expressions.py daft/convert.py daft/udfs.py
pytest --doctest-modules --continue-on-collection-errors daft/dataframe/dataframe.py daft/expressions/expressions.py daft/convert.py daft/udf.py
publish-coverage-reports:
name: Publish coverage reports to CodeCov
Expand Down
2 changes: 1 addition & 1 deletion daft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def refresh_logger() -> None:
)
from daft.series import Series
from daft.sql import sql, sql_expr
from daft.udfs import udf
from daft.udf import udf
from daft.viz import register_viz_hook

to_struct = Expression.to_struct
Expand Down
2 changes: 1 addition & 1 deletion daft/daft/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ from daft.io.scan import ScanOperator
from daft.plan_scheduler.physical_plan_scheduler import PartitionT
from daft.runners.partitioning import PartitionCacheEntry
from daft.sql.sql_connection import SQLConnection
from daft.udfs import InitArgsType, PartialStatefulUDF, PartialStatelessUDF
from daft.udf import InitArgsType, PartialStatefulUDF, PartialStatelessUDF

if TYPE_CHECKING:
import pyarrow as pa
Expand Down
4 changes: 2 additions & 2 deletions daft/expressions/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import builtins

from daft.io import IOConfig
from daft.udfs import PartialStatefulUDF, PartialStatelessUDF
from daft.udf import PartialStatefulUDF, PartialStatelessUDF
# This allows Sphinx to correctly work against our "namespaced" accessor functions by overriding @property to
# return a class instance of the namespace instead of a property object.
elif os.getenv("DAFT_SPHINX_BUILD") == "1":
Expand Down Expand Up @@ -1001,7 +1001,7 @@ def apply(self, func: Callable, return_dtype: DataType) -> Expression:
Returns:
Expression: New expression after having run the function on the expression
"""
from daft.udfs import CommonUDFArgs, StatelessUDF
from daft.udf import CommonUDFArgs, StatelessUDF

def batch_func(self_series):
return [func(x) for x in self_series.to_pylist()]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion daft/udf_library/url_udfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from daft import filesystem
from daft.datatype import DataType
from daft.series import Series
from daft.udfs import udf
from daft.udf import udf

thread_local = threading.local()

Expand Down
10 changes: 5 additions & 5 deletions docs/source/api_docs/udf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ User-Defined Functions (UDFs) are a mechanism to run Python code on the data tha
A UDF can be used just like :doc:`Expressions <../user_guide/expressions>`, allowing users to express computation that
should be executed by Daft lazily.

To write a UDF, you should use the :func:`@udf <daft.udfs.udf>` decorator, which can decorate either a Python
function or a Python class, producing either a :class:`StatelessUDF <daft.udfs.StatelessUDF>` or
:class:`StatefulUDF <daft.udfs.StatefulUDF>` respectively.
To write a UDF, you should use the :func:`@udf <daft.udf.udf>` decorator, which can decorate either a Python
function or a Python class, producing either a :class:`StatelessUDF <daft.udf.StatelessUDF>` or
:class:`StatefulUDF <daft.udf.StatefulUDF>` respectively.

For more details, please consult the :doc:`UDF User Guide <../user_guide/udf>`

Expand All @@ -23,10 +23,10 @@ Creating UDFs
Using UDFs
==========

.. autoclass:: daft.udfs.StatelessUDF
.. autoclass:: daft.udf.StatelessUDF
:members:
:special-members: __call__

.. autoclass:: daft.udfs.StatefulUDF
.. autoclass:: daft.udf.StatefulUDF
:members:
:special-members: __call__
2 changes: 1 addition & 1 deletion tests/cookbook/test_aggregations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from daft.datatype import DataType
from daft.expressions import col
from daft.udfs import udf
from daft.udf import udf
from tests.conftest import assert_df_equals


Expand Down
2 changes: 1 addition & 1 deletion tests/expressions/test_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from daft.expressions.testing import expr_structurally_equal
from daft.series import Series
from daft.table import MicroPartition
from daft.udfs import udf
from daft.udf import udf


@pytest.fixture(scope="function", params=[False, True])
Expand Down

0 comments on commit 6cc691e

Please sign in to comment.