# Programmable filter error: "isinstance" not working in PV5.5.0

**URL:** https://discourse.paraview.org/t/programmable-filter-error-isinstance-not-working-in-pv5-5-0/1719
**Category:** ParaView Support
**Tags:** python
**Created:** [April 25, 2019, 9:42am UTC](https://discourse.paraview.org/t/programmable-filter-error-isinstance-not-working-in-pv5-5-0/1719 "2019-04-25T09:42:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MiguelAngelAGUIRRE](https://discourse.paraview.org/user_avatar/discourse.paraview.org/miguelangelaguirre/32/2986_2.png) [@MiguelAngelAGUIRRE](https://discourse.paraview.org/u/MiguelAngelAGUIRRE)
#### Post date: [April 25, 2019, 9:42am UTC](https://discourse.paraview.org/t/programmable-filter-error-isinstance-not-working-in-pv5-5-0/1719/1 "2019-04-25T09:42:40Z")

</div>

Hello,

I have a very simple programmable filter that detects if an array exists or not in the input data (it uses “isinstance” in order to detect that). It works fine for PV5.4.0 and older versions but for PV5.5.0 and newer versions it is no longer working.

How can I modify it to make it work?

Please, find in the attached file 2 PVSM files: one that works fine in PV5.4.0 and the other that does not work properly in PV5.4.0.

In both cases I use this:

isinstance(inputs[0].GetPointData().GetArray("Z\_VELOCITY"), vtk.numpy\_interface.dataset\_adapter.VTKNoneArray)

If the array “Z\_VELOCITY” does not exists, its output should be “True”

Thanks in advance!

Miguel

[PV\_ERROR\_TEST.cas](https://discourse.paraview.org/uploads/default/original/1X/aa818fc98fcb688ea2daeedf1da15fff522f667f.cas) (298.6 KB)  
[PV\_ERROR\_TEST.dat](https://discourse.paraview.org/uploads/default/original/1X/a8efd9b7a440e42062b4b8c59f20fe8ea4b8210d.dat) (491.3 KB)  
[STATE\_error\_PV5\_5\_0.pvsm](https://discourse.paraview.org/uploads/default/original/2X/e/e2851456f20ba8dea55534207320cebf4c8902ae.pvsm) (685.1 KB)  
[STATE\_reference\_PV5\_4\_0.pvsm](https://discourse.paraview.org/uploads/default/original/2X/d/d1c8776d41588fae7cd4f6d45cd8ac3b8102101c.pvsm) (656.6 KB)

---

<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: [April 25, 2019, 12:32pm UTC](https://discourse.paraview.org/t/programmable-filter-error-isinstance-not-working-in-pv5-5-0/1719/2 "2019-04-25T12:32:37Z")

</div>

I’m not sure why `isinstance` doesn’t work, but I can suggest that you could use

```python
inputs[0].GetPointData().HasArray("Z_VELOCITY") == 0

```

for the same purpose

---

<div class="post-metadata">

### Author: ![MiguelAngelAGUIRRE](https://discourse.paraview.org/user_avatar/discourse.paraview.org/miguelangelaguirre/32/2986_2.png) [@MiguelAngelAGUIRRE](https://discourse.paraview.org/u/MiguelAngelAGUIRRE)
#### Post date: [April 26, 2019, 8:41am UTC](https://discourse.paraview.org/t/programmable-filter-error-isinstance-not-working-in-pv5-5-0/1719/3 "2019-04-26T08:41:34Z")

</div>

Hello Cory,

That works perfectly fine for all Paraview versions. Thank you very much for your accurate and quick answer!

Best regards,

Miguel
