# Python client returns deleted records

**URL:** <https://discuss.aerospike.com/t/python-client-returns-deleted-records/2806>\
**Category:** Python Client\
**Tags:** deletion\
**Created:** [April 12, 2016, 11:16am UTC](https://discuss.aerospike.com/t/python-client-returns-deleted-records/2806 "2016-04-12T11:16:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amod](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/amod/32/221_2.png) [@Amod](https://discuss.aerospike.com/u/Amod)\
**Post date:** [April 12, 2016, 11:16am UTC](https://discuss.aerospike.com/t/python-client-returns-deleted-records/2806/1 "2016-04-12T11:16:23Z")

</div>

I have deleted record for which

aql\> select \* from default where PK = ‘my\_key’ Error: (2) AEROSPIKE\_ERR\_RECORD\_NOT\_FOUND

Java client - get returns rull, exists returns false

Python (key, metadata, bins) = client.get((namespace,setname,key1)) print key print client.exists((namespace,setname,key1))

both of them returns values

aerospike client - 1.0.57

---

<div class="post-metadata">

**Author:** ![Amod](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/amod/32/221_2.png) [@Amod](https://discuss.aerospike.com/u/Amod)\
**Post date:** [April 12, 2016, 11:25am UTC](https://discuss.aerospike.com/t/python-client-returns-deleted-records/2806/2 "2016-04-12T11:25:18Z")

</div>

Ah, it returns the key (with is the first in the tuple).

But ideally the python exists should return true/false as the function name suggests and not (key, meta)

So, i we are using exists function, should be check if the meta of the tuple (key, meta) is None for a deleted record?

---

<div class="post-metadata">

**Author:** ![Amod](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/amod/32/221_2.png) [@Amod](https://discuss.aerospike.com/u/Amod)\
**Post date:** [April 12, 2016, 3:35pm UTC](https://discuss.aerospike.com/t/python-client-returns-deleted-records/2806/3 "2016-04-12T15:35:12Z")

</div>

Works fine with 2.0.2

exception.RecordNotFound: (2L, ‘AEROSPIKE\_ERR\_RECORD\_NOT\_FOUND’, ‘src/main/client/get.c’, 113)

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [April 12, 2016, 3:51pm UTC](https://discuss.aerospike.com/t/python-client-returns-deleted-records/2806/4 "2016-04-12T15:51:00Z")

</div>

Hey Amod, you’re right. This was one of the changes in the [2.0.0 release](https://github.com/aerospike/aerospike-client-python/releases/tag/2.0.0) of the Python client.
