# Session.run nodes changed type from 1.7.6 to 4.x

**URL:** <https://community.neo4j.com/t/session-run-nodes-changed-type-from-1-7-6-to-4-x/59438>\
**Category:** Drivers & Stacks\
**Tags:** migrated\
**Created:** [August 16, 2022, 4:39pm UTC](https://community.neo4j.com/t/session-run-nodes-changed-type-from-1-7-6-to-4-x/59438 "2022-08-16T16:39:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielflippance](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/danielflippance/32/26219_2.png) [@danielflippance](https://community.neo4j.com/u/danielflippance)\
**Post date:** [August 16, 2022, 4:39pm UTC](https://community.neo4j.com/t/session-run-nodes-changed-type-from-1-7-6-to-4-x/59438/1 "2022-08-16T16:39:28Z")

</div>

In the python 1.7.6 driver, we call session.run(...) for a simple MATCH query and see that the returned data has nodes where the type of the class is Node:

```auto
type(i). __name__ : Node

```

When we do the same call in any 4.x version, the data comes back as a dict:

```auto
type(i). __name__ : dict

```

Is this an expected change to the python driver made for version 4? I didn't find any reference to this change in the release notes [https://github.com/neo4j/neo4j-python-driver/releases](https://github.com/neo4j/neo4j-python-driver/releases)

If so, is there a way to have the data returned with Node class type instead of dict?

---

<div class="post-metadata">

**Author:** ![danielflippance](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/danielflippance/32/26219_2.png) [@danielflippance](https://community.neo4j.com/u/danielflippance)\
**Post date:** [August 18, 2022, 6:43pm UTC](https://community.neo4j.com/t/session-run-nodes-changed-type-from-1-7-6-to-4-x/59438/2 "2022-08-18T18:43:55Z")

</div>

aha, yes, we're doing exactly what you guessed: result.data()

We'll switch to result.single() or similar and see how that works out.

---

<div class="post-metadata">

**Author:** ![rouven\_bauer](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/rouven_bauer/32/16547_2.png) [@rouven\_bauer](https://community.neo4j.com/u/rouven_bauer)\
**Post date:** [August 18, 2022, 11:13am UTC](https://community.neo4j.com/t/session-run-nodes-changed-type-from-1-7-6-to-4-x/59438/3 "2022-08-18T11:13:46Z")

</div>

This is a shot in the dark, but maybe you are using `Result.data() `([https://neo4j.com/docs/api/python-driver/4.4/api.html#neo4j.Result.data](https://neo4j.com/docs/api/python-driver/4.4/api.html#neo4j.Result.data)). Generally, I'd not recommend to use it for anything but prototyping and debugging. It has its limitations and is more the type of API to get you started quickly but less so to give you full control of what's going on under the hood.

---

<div class="post-metadata">

**Author:** ![rouven\_bauer](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/rouven_bauer/32/16547_2.png) [@rouven\_bauer](https://community.neo4j.com/u/rouven_bauer)\
**Post date:** [August 18, 2022, 11:08am UTC](https://community.neo4j.com/t/session-run-nodes-changed-type-from-1-7-6-to-4-x/59438/4 "2022-08-18T11:08:07Z")

</div>

Can you share a little more of your code, please?  
Where exactly does `i` come from? I wasn't able to reproduce what you describe.

Here is a code snipped run on the 4.4 branch of the Python driver (dev snapshot, but should be the same for all of at least 4.4):

```auto
with neo4j.GraphDatabase.driver(uri, auth=auth) as driver:
    with driver.session(database="neo4j") as session:
        result = session.run("MERGE (n:Foo {bar: 'baz'}) RETURN n")
        record = result.single()
        node = record["n"]
        print(type(node))

```

Which prints `<class 'neo4j.graph.Node'>` .

---

<div class="post-metadata">

**Author:** ![danielflippance](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/danielflippance/32/26219_2.png) [@danielflippance](https://community.neo4j.com/u/danielflippance)\
**Post date:** [September 6, 2022, 11:19pm UTC](https://community.neo4j.com/t/session-run-nodes-changed-type-from-1-7-6-to-4-x/59438/5 "2022-09-06T23:19:38Z")

</div>

Switching to result.single() solved the problem. Thanks [@rouven\_bauer](https://community.neo4j.com/t5/user/viewprofilepage/user-id/7004)
