apache/pulsar · error · IllegalArgumentException

There is currently no support windowing in python

Error message

There is currently no support windowing in python

What it means

Windowing is only supported for the Java runtime. doPythonChecks throws IllegalArgumentException when a Python function config carries a WindowConfig, since the Python runtime has no windowing implementation.

Source

Thrown at pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:757

        if (functionConfig.getProducerConfig() != null
                && functionConfig.getProducerConfig().getCryptoConfig() != null) {
            ValidatorUtils
                    .validateCryptoKeyReader(functionConfig.getProducerConfig().getCryptoConfig(),
                            validatableFunctionPackage.getTypePool(), true);
        }
        return new FunctionConfigUtils.ExtractedFunctionDetails(
                functionClassName,
                typeArgs[0].asErasure().getTypeName(),
                typeArgs[1].asErasure().getTypeName());
    }

    private static void doPythonChecks(FunctionConfig functionConfig) {
        if (functionConfig.getProcessingGuarantees() == FunctionConfig.ProcessingGuarantees.EFFECTIVELY_ONCE) {
            throw new RuntimeException("Effectively-once processing guarantees not yet supported in Python");
        }

        if (functionConfig.getWindowConfig() != null) {
            throw new IllegalArgumentException("There is currently no support windowing in python");
        }

        if (functionConfig.getMaxMessageRetries() != null && functionConfig.getMaxMessageRetries() >= 0) {
            throw new IllegalArgumentException("Message retries not yet supported in python");
        }
    }

    private static void doGolangChecks(FunctionConfig functionConfig) {
        if (functionConfig.getProcessingGuarantees() == FunctionConfig.ProcessingGuarantees.EFFECTIVELY_ONCE) {
            throw new RuntimeException("Effectively-once processing guarantees not yet supported in Go function");
        }

        if (functionConfig.getWindowConfig() != null) {
            throw new IllegalArgumentException("Windowing is not supported in Go function yet");
        }

        if (functionConfig.getMaxMessageRetries() != null && functionConfig.getMaxMessageRetries() >= 0) {
            throw new IllegalArgumentException("Message retries not yet supported in Go function");

View on GitHub (pinned to 820761864e)

Solutions

  1. Remove the windowConfig for Python functions and aggregate state manually in the function
  2. Implement the windowed function in Java where windowing is supported
  3. Handle windowing upstream (e.g. in a consumer) instead of via function windowing

Example fix

// before
config.setWindowConfig(windowConfig); // python runtime
// after
// no windowConfig; implement aggregation inside the Python function
Defensive patterns

Strategy: validation

Validate before calling

if (config.getRuntime() == FunctionConfig.Runtime.PYTHON && config.getWindowConfig() != null) { throw new IllegalArgumentException("Windowing is unsupported for Python functions"); }

Type guard

boolean pythonWindowingSupported(FunctionConfig c) { return c.getRuntime() != FunctionConfig.Runtime.PYTHON || c.getWindowConfig() == null; }

Try / catch

try { ... } catch (IllegalArgumentException e) { if (e.getMessage().contains("no support windowing in python")) { log.error("Remove windowConfig or move to Java runtime"); } }

Prevention

When it happens

Trigger: Submitting a function with runtime PYTHON and setWindowConfig(...) non-null (tumbling/sliding/session window configuration).

Common situations: Porting a Java windowed function to Python; config generators that attach window settings unconditionally.

Related errors


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/d275b59c07c9e3a5. Report an issue: GitHub.