# Pydataset has not attribute error

**URL:** <https://forum.inductiveautomation.com/t/pydataset-has-not-attribute-error/62755>\
**Category:** Ignition\
**Created:** [August 7, 2022, 7:07pm UTC](https://forum.inductiveautomation.com/t/pydataset-has-not-attribute-error/62755 "2022-08-07T19:07:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [August 7, 2022, 7:07pm UTC](https://forum.inductiveautomation.com/t/pydataset-has-not-attribute-error/62755/1 "2022-08-07T19:07:55Z")

</div>

I get this error when trying to run this script, and not really sure what’s wrong here. There was another post regarding this code I cleaned up, I don’t remember anyone pointing out anything in regards to that.

Ignition 7.8.5  
Error:

```auto
Traceback (most recent call last):
  File "<event:actionPerformed>", line 26, in <module>
AttributeError: 'com.inductiveautomation.ignition.common.script.Scr' object has no attribute 'toPyDataset'

	at org.python.core.Py.AttributeError(Py.java:173)
	at org.python.core.PyObject.noAttributeError(PyObject.java:930)
	at org.python.core.PyObject. __getattr__ (PyObject.java:925)
	at org.python.pycode._pyx10.f$0(<event:actionPerformed>:39)
	at org.python.pycode._pyx10.call_function(<event:actionPerformed>)
	at org.python.core.PyTableCode.call(PyTableCode.java:165)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1275)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:631)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:590)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:170)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:265)
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
	at com.sun.proxy.$Proxy31.actionPerformed(Unknown Source)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

Ignition v7.8.5 (b2016120813)
Java: Oracle Corporation 1.8.0_271

```

relevant script:

```auto
else:
    #Dictionary to place valve location dataset in.
    CRvalveTo = {}
    #Dataset of valve locations
    ValveDataset = system.dataset.toPyDataset(system.tag.read("System1/Project1/HOA/Valves").value)
    #Puts dataset into a dict
    for rowRead in ValveDataset:
        CRvalveTo[rowRead['id']] = rowRead['description']
    #Gets transfer location
    valveCrossx = CRvalveTo[valve]

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 7, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/pydataset-has-not-attribute-error/62755/2 "2022-08-07T19:29:13Z")

</div>

> [@andrews](#):
>
> `system.dataset.toPyDataset`

Typo, it's `system.dataset.toPyDataSet`, capital 'S'.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [August 8, 2022, 12:58am UTC](https://forum.inductiveautomation.com/t/pydataset-has-not-attribute-error/62755/3 "2022-08-08T00:58:32Z")

</div>

@Kevin.Herron typo strikes again!

Thanks

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 8, 2022, 1:10am UTC](https://forum.inductiveautomation.com/t/pydataset-has-not-attribute-error/62755/4 "2022-08-08T01:10:36Z")

</div>

Not your fault. Our codebase and documentation are maddeningly inconsistent in when it comes to “Dataset” vs “DataSet”. Every mention on the doc page is “Dataset” or “PyDataset” except the function names, with are case sensitive “DataSet”.

Internally, the interface is `Dataset`, the Jython impl is `PyDataSet`, and all the other impls are a mix… 😡
