Skip to content

Commit 99cc134

Browse files
Merge pull request #27 from SlicingDice/update-exists-entity
Update existsEntity
2 parents e1f8560 + e2b6ac3 commit 99cc134

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [2.0.0]
44
### Updated
5+
- Update `exists_entity()` to receive `table` as parameter
56
- Update API errors code
67
- Remove auto_create_columns parameter from insert method
78
- Rename SlicingDice API endpoints

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ print client.insert(insert_data)
230230
}
231231
```
232232

233-
### `exists_entity(ids)`
234-
Verify which entities exist in a database given a list of entity IDs. This method corresponds to a [POST request at /query/exists/entity](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-query-exists-entity).
233+
### `exists_entity(ids, table=None)`
234+
Verify which entities exist in a table (uses `default` table if not provided) given a list of entity IDs. This method corresponds to a [POST request at /query/exists/entity](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-query-exists-entity).
235235

236236
#### Request example
237237

pyslicer/client.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,12 @@ def top_values(self, query):
278278
req_type="post",
279279
key_level=0)
280280

281-
def exists_entity(self, ids):
281+
def exists_entity(self, ids, table=None):
282282
"""Make a exists entity query
283283
284284
Keyword arguments:
285-
ids -- A list with entity to check if exists
285+
ids -- A list with entities to check if exists
286+
table -- In which table entities check be checked
286287
"""
287288
base_url = self._wrapper_test()
288289
url = base_url + URLResources.QUERY_EXISTS_ENTITY
@@ -292,6 +293,8 @@ def exists_entity(self, ids):
292293
query = {
293294
'ids': ids
294295
}
296+
if table:
297+
query['table'] = table
295298
return self._make_request(
296299
url=url,
297300
json_data=ujson.dumps(query),

0 commit comments

Comments
 (0)