Skip to content

Commit

Permalink
Remove deprecated parent_id param
Browse files Browse the repository at this point in the history
  • Loading branch information
brusteca committed Feb 21, 2020
1 parent a180123 commit d656c46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ response = ml.classifiers.tags.detail('[MODEL_ID]', TAG_ID)


```python
def MonkeyLearn.classifiers.tags.create(model_id, name, parent_id=None, retry_if_throttled=True)
def MonkeyLearn.classifiers.tags.create(model_id, name, retry_if_throttled=True)
```

Parameters:
Expand All @@ -448,7 +448,6 @@ Parameters:
|--------------------|-------------------|-----------------------------------------------------------|
|*model_id* |`str` |Classifier ID. It always starts with `'cl'`, for example, `'cl_oJNMkt2V'`. |
|*name* |`str` |The name of the new tag. |
|*parent_id* |`int` |**DEPRECATED** (only for v2 models). The ID of the parent tag. |
|*retry_if_throttled* |`bool` |If a request is [throttled](https://monkeylearn.com/api/v3/#query-limits), sleep and retry the request. |

Example:
Expand All @@ -463,7 +462,7 @@ response = ml.classifiers.tags.create('[MODEL_ID]', 'Positive')


```python
def MonkeyLearn.classifiers.tags.edit(model_id, tag_id, name=None, parent_id=None,
def MonkeyLearn.classifiers.tags.edit(model_id, tag_id, name=None,
retry_if_throttled=True)
```

Expand All @@ -474,7 +473,6 @@ Parameters:
|*model_id* |`str` |Classifier ID. It always starts with `'cl'`, for example, `'cl_oJNMkt2V'`. |
|*tag_id* |`int` |Tag ID. |
|*name* |`str` |The new name of the tag. |
|*parent_id* |`int` |**DEPRECATED** (only for v2 models). The new parent tag ID. |
|*retry_if_throttled* |`bool` |If a request is [throttled](https://monkeylearn.com/api/v3/#query-limits), sleep and retry the request. |

Example:
Expand Down
6 changes: 2 additions & 4 deletions monkeylearn/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,17 @@ def detail(self, model_id, tag_id, retry_if_throttled=True):
response = self.make_request('GET', url, retry_if_throttled=retry_if_throttled)
return MonkeyLearnResponse(response)

def create(self, model_id, name, parent_id=None, retry_if_throttled=True):
def create(self, model_id, name, retry_if_throttled=True):
data = self.remove_none_value({
'name': name,
'parent_id': parent_id
})
url = self.get_nested_list_url(model_id)
response = self.make_request('POST', url, data, retry_if_throttled=retry_if_throttled)
return MonkeyLearnResponse(response)

def edit(self, model_id, tag_id, name=None, parent_id=None, retry_if_throttled=True):
def edit(self, model_id, tag_id, name=None, retry_if_throttled=True):
data = self.remove_none_value({
'name': name,
'parent_id': parent_id
})
url = self.get_nested_detail_url(model_id, tag_id)
response = self.make_request('PATCH', url, data, retry_if_throttled=retry_if_throttled)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='monkeylearn',
version='3.5.1',
version='3.5.2',
author='MonkeyLearn',
author_email='[email protected]',
description='Official Python client for the MonkeyLearn API',
Expand Down

0 comments on commit d656c46

Please sign in to comment.