Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
10538fd
[FLINK-40431][python] Support scalar UDFs in DataFrame API
auroflow Aug 26, 2026
4bb5b9f
[FLINK-40431][python] Centralize DataFrame UDF source resolution
auroflow Aug 27, 2026
7722acb
[FLINK-40431][python] Initialize UDF class declarations on TaskManagers
auroflow Aug 27, 2026
9deab13
[FLINK-40431][python] Fix DataFrame UDF test override signatures
auroflow Aug 27, 2026
b5a0e5d
[FLINK-40431][python] Address DataFrame UDF review feedback
auroflow Aug 28, 2026
13b4378
[FLINK-40431][python] Hide DataFrame UDF wrapper implementation
auroflow Aug 28, 2026
c2571c7
[FLINK-40431][python] Optimize DataFrame UDF Row normalization
auroflow Aug 28, 2026
135d38f
[FLINK-40431][python] Clarify DataFrame UDF type handling
auroflow Aug 28, 2026
20404b3
[FLINK-40431][python] Fix DataFrame UDF type hint resolution
auroflow Aug 30, 2026
577d9bf
[FLINK-40431][python] Fix callable UDF annotation resolution
auroflow Sep 1, 2026
7691f9d
[FLINK-40431][python] Harden callable UDF inference
auroflow Sep 1, 2026
2dcfc85
[FLINK-40431][python] Clarify DataFrame UDF worker lifecycle
auroflow Sep 1, 2026
771fd68
[FLINK-40431][python] Validate partial UDF declarations
auroflow Sep 1, 2026
041273c
[FLINK-40431][python] Simplify UDF declaration helpers
auroflow Sep 1, 2026
dea873d
[FLINK-40431][python] Fix callable signature type narrowing
auroflow Sep 1, 2026
be3a2a4
[FLINK-40431][python] Harden wrapped and async UDF declarations
auroflow Sep 1, 2026
6d8b772
[FLINK-40431][python] Improve UDF declaration errors
auroflow Sep 1, 2026
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flink-python/docs/reference/pyflink.dataframe/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This page gives an overview of all public PyFlink DataFrame APIs.
:maxdepth: 1

dataframe
udf
creation
io
datatype
Expand Down
41 changes: 41 additions & 0 deletions flink-python/docs/reference/pyflink.dataframe/udf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. ################################################################################
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
################################################################################

=============================
User-Defined Scalar Functions
=============================

Use :func:`pyflink.dataframe.udf` to apply Python code to one or more DataFrame
columns. A scalar UDF produces one logical output column and can be used in
:meth:`~pyflink.dataframe.DataFrame.with_column`,
:meth:`~pyflink.dataframe.DataFrame.with_columns`, and
:meth:`~pyflink.dataframe.DataFrame.select`.

DataFrame scalar UDFs support synchronous, asynchronous, and pandas-vectorized
callables. See :func:`pyflink.dataframe.udf` for declaration forms, type
inference, execution modes, and examples.

API Reference
=============

.. currentmodule:: pyflink.dataframe

.. autosummary::
:toctree: api/

udf
2 changes: 2 additions & 0 deletions flink-python/pyflink/dataframe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
from pyflink.dataframe.dataframe import DataFrame, GroupedDataFrame, col, lit
from pyflink.dataframe.datatype import DataType
from pyflink.dataframe.io import read_generic
from pyflink.dataframe.udf import udf

__all__ = [
"DataFrame",
"GroupedDataFrame",
"DataType",
"col",
"lit",
"udf",
"from_arrow",
"from_dict",
"from_pandas",
Expand Down
11 changes: 10 additions & 1 deletion flink-python/pyflink/dataframe/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,19 @@ def with_column(

>>> import pyflink.dataframe as pf
>>> df = pf.from_records([{"left": 1, "right": 2}])
>>> result = df.with_column(

>>> with_expression = df.with_column(
... "total", lambda current: current["left"] + current["right"]
... )

>>> @pf.udf
... def add(left: int, right: int) -> int:
... return left + right

>>> with_udf = df.with_column(
... "total", add(pf.col("left"), pf.col("right"))
... )

.. versionadded:: 2.4.0
"""
if not isinstance(name, str):
Expand Down
Loading