Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions monkeylearn/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from monkeylearn.utils import SleepRequestsMixin, MonkeyLearnResponse, HandleErrorsMixin
from monkeylearn.settings import PIPELINES_ENDPOINT
from monkeylearn.exceptions import MonkeyLearnException

class Pipelines(SleepRequestsMixin, HandleErrorsMixin):

Expand All @@ -12,6 +13,8 @@ def __init__(self, token):
self.endpoint = PIPELINES_ENDPOINT

def run(self, module_id, data, sandbox=False, sleep_if_throttled=True):
if not isinstance(data, dict):
raise MonkeyLearnException('The data parameter must be a dictionary')
url = self.endpoint + module_id + '/run/'
if sandbox:
url += '?sandbox=1'
Expand Down