# updatePipeline of programmable filter overwriting the max function

**URL:** https://discourse.paraview.org/t/updatepipeline-of-programmable-filter-overwriting-the-max-function/17711
**Category:** ParaView Support
**Created:** [September 3, 2026, 7:39am UTC](https://discourse.paraview.org/t/updatepipeline-of-programmable-filter-overwriting-the-max-function/17711 "2026-09-03T07:39:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [September 3, 2026, 7:39am UTC](https://discourse.paraview.org/t/updatepipeline-of-programmable-filter-overwriting-the-max-function/17711/1 "2026-09-03T07:39:54Z")

</div>

first of all i must say that i was able to pinpoint this issue thanks to LLM.  
my code was working correctly when using paraview/python shell and running my code but when i was running it with pvbatch i was getting an error of the max() function not having the default input. this went thought a rabbit hole of ‘I am importing with wild cards, but this has been always worked etc etc’  
and at the end i was able to pin point it when doing the pudate of the programmable filter.

```py
import builtins

def checkMax(label):

print(f"{label}: {max} | built-in={max is builtins.max}",flush=True)

checkMax("13a")

self.programmableFilter.UpdatePipeline()

checkMax("13b")

```

which i was getting:

```auto
13a: <built-in function max> | built-in=True
13b: <function max at 0x7c527d068b80> | built-in=False

```

I made a small script that can reproduce this issue:

```auto
from paraview.simple import *
import builtins

print("BEFORE:",max)
print("BEFORE is builtins.max:",max is builtins.max)

# Create a simple input
sphere=Sphere()

# Create a Programmable Filter similar to yours
programmableFilter=ProgrammableFilter(Input=sphere)

script="""
import numpy as np
inputData=inputs[0]
output=self.GetOutput()
output.ShallowCopy(inputData.VTKObject)
"""

programmableFilter.Script=script

print("BEFORE UpdatePipeline:",max)
print("BEFORE is builtins.max:",max is builtins.max)

programmableFilter.UpdatePipeline()

print("AFTER UpdatePipeline:",max)
print("AFTER is builtins.max:",max is builtins.max)

# Test Python's max(default=...)
try:
    result=max([],default=-1)
    print("max works:",result)
except Exception as e:
    print("max FAILED:",type(e). __name__ ,e)

```

I am getting a reproductable result:

```auto
BEFORE: <built-in function max>
BEFORE is builtins.max: True
BEFORE UpdatePipeline: <built-in function max>
BEFORE is builtins.max: True
AFTER UpdatePipeline: <function max at 0x71ec97372200>
AFTER is builtins.max: False
max FAILED: TypeError max() got an unexpected keyword argument 'default'

```

which is quite strange… 😅 (at least for me)  
this happens to me with pvbatch and pvpython

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [September 3, 2026, 8:54am UTC](https://discourse.paraview.org/t/updatepipeline-of-programmable-filter-overwriting-the-max-function/17711/2 "2026-09-03T08:54:07Z")

</div>

Indeed, I reproduce on the dev branch of ParaView!

Adding

```auto
except Exception as e:
   help(max)

```

Points the faulty ParaView module that override it

```auto
paraview.vtk.numpy_interface.algorithms

```

Definitely an issue, can you open a ticket please?

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [September 3, 2026, 8:59am UTC](https://discourse.paraview.org/t/updatepipeline-of-programmable-filter-overwriting-the-max-function/17711/3 "2026-09-03T08:59:31Z")

</div>

created [https://gitlab.kitware.com/paraview/paraview/-/work\_items/23382](https://gitlab.kitware.com/paraview/paraview/-/work_items/23382)  
crazy bug that had not bitten some persons before now to be found…

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [September 3, 2026, 1:14pm UTC](https://discourse.paraview.org/t/updatepipeline-of-programmable-filter-overwriting-the-max-function/17711/4 "2026-09-03T13:14:26Z")

</div>

People have run into related issues before:

> [@Programmable Filter - TypeError: min() got an unexpected keyword argument 'key'](https://discourse.paraview.org/t/programmable-filter-typeerror-min-got-an-unexpected-keyword-argument-key/4454):
>
> Hi, I have a a model with a temperature field. I have a .csv file with the fraction solid Vs temperature data. I am trying to use a programmable filter to read in the fraction solid data, then for each cell interpolate the Fraction Solid based on the temperature data. I’m struggling with the error: TypeError: min() got an unexpected keyword argument ‘key’ The function getFracLiq requires a float value. I pass in float with a value not requiring interpolation then the script works (temp = 700…

I’m not saying it’s great to have to do, but to be safe use `builtins.max` when you want the builtin max.

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [September 3, 2026, 1:19pm UTC](https://discourse.paraview.org/t/updatepipeline-of-programmable-filter-overwriting-the-max-function/17711/5 "2026-09-03T13:19:42Z")

</div>

yeah it is what i am actually doing, specially that i was using max in other situations where the numpy version was not working at all. but i am surprised that the post you cited is from 2000s, i have been reporting a lot of small bugs here and there (i use quite strangelly paraview and have a strange logic on my head so i have tendency of finding small bugs around, the folks at salome are tired of hearing about my github issues ahahah). but this one could be quite big as one would be using a different library which could be different results… i guess most of the time one uses max/min in classing array/list situation giving same result, but there might be some more complex functions where this could impact. one is thinking it is using something but it is using something else without much ‘knowledge’ about
