Skip to content

fastflowtransform.executors._spark_imports

get_spark_window

get_spark_window()

Lazy import for pyspark.sql.Window.

Raises:

Type Description
RuntimeError

if pyspark is not installed or import fails.

Source code in src/fastflowtransform/executors/_spark_imports.py
33
34
35
36
37
38
39
40
41
42
43
44
def get_spark_window():
    """
    Lazy import for pyspark.sql.Window.

    Raises:
        RuntimeError: if pyspark is not installed or import fails.
    """
    try:
        from pyspark.sql import Window  # noqa PLC0415
    except Exception as exc:  # pragma: no cover
        raise _spark_missing_error(exc) from exc
    return Window

get_spark_functions

get_spark_functions()

Lazy import for pyspark.sql.functions as F.

Raises:

Type Description
RuntimeError

if pyspark is not installed or import fails.

Source code in src/fastflowtransform/executors/_spark_imports.py
46
47
48
49
50
51
52
53
54
55
56
57
def get_spark_functions():
    """
    Lazy import for pyspark.sql.functions as F.

    Raises:
        RuntimeError: if pyspark is not installed or import fails.
    """
    try:
        from pyspark.sql import functions as F  # noqa PLC0415
    except Exception as exc:  # pragma: no cover
        raise _spark_missing_error(exc) from exc
    return F