Skip to content

Correct contract typo in the docstring of AsyncEmitter's constructor #147

@kmmats

Description

Just installed snowplow-tracker-0.7.1 and pycontracts-1.7.6 from pip, when trying to do the initial import I get the following error message:

Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 17:02:03)
Type "copyright", "credits" or "license" for more information.

IPython 3.2.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]: from snowplow_tracker import Subject, Tracker, Emitter

ContractException Traceback (most recent call last)
in ()
----> 1 from snowplow_tracker import Subject, Tracker, Emitter

/home/ubuntu/anaconda/envs/papertrailpull/lib/python2.7/site-packages/snowplow_tracker/init.py in ()
1 from snowplow_tracker._version import version
2 from snowplow_tracker.subject import Subject
----> 3 from snowplow_tracker.emitters import logger, Emitter, AsyncEmitter, CeleryEmitter, RedisEmitter
4 from snowplow_tracker.self_describing_json import SelfDescribingJson
5 from snowplow_tracker.tracker import Tracker

/home/ubuntu/anaconda/envs/papertrailpull/lib/python2.7/site-packages/snowplow_tracker/emitters.py in ()
246 logger.info("Skipping flush since buffer is empty")
247
--> 248 class AsyncEmitter(Emitter):
249 """
250 Uses threads to send HTTP requests asynchronously

/home/ubuntu/anaconda/envs/papertrailpull/lib/python2.7/site-packages/snowplow_tracker/emitters.py in AsyncEmitter()
261 on_success=None,
262 on_failure=None,
--> 263 thread_count=1):
264 """
265 :param endpoint: The collector URL. Don't include "http://" - this is done automatically.

/home/ubuntu/anaconda/envs/papertrailpull/lib/python2.7/site-packages/contracts/init.pyc in contract(_args, *_kwargs)
22 # So that Eclipse and other IDEs will not get confused.
23 def contract(_args, *_kwargs):
---> 24 return contract_decorator(_args, *_kwargs)
25
26

/home/ubuntu/anaconda/envs/papertrailpull/lib/python2.7/site-packages/contracts/main.pyc in contract_decorator(_arg, *_kwargs)
144 return function
145 try:
--> 146 return contracts_decorate(function, **kwargs)
147 except ContractSyntaxError as es:
148 # Erase the stack

/home/ubuntu/anaconda/envs/papertrailpull/lib/python2.7/site-packages/contracts/main.pyc in contracts_decorate(function_, modify_docstring, **kwargs)
234 'find a docstring for %r.' % function_)
235
--> 236 accepts_dict, returns = parse_contracts_from_docstring(function_)
237
238 if not accepts_dict and not returns:

/home/ubuntu/anaconda/envs/papertrailpull/lib/python2.7/site-packages/contracts/main.pyc in parse_contracts_from_docstring(function)
403 ' find in my list of arguments (%r)' %
404 (name, all_args))
--> 405 raise ContractException(msg)
406
407 if len(name2type) != len(all_args): # pragma: no cover

ContractException: A contract was specified for argument 'requests' which I cannot find in my list of arguments (['self', 'endpoint', 'protocol', 'port', 'method', 'buffer_size', 'on_success', 'on_failure', 'thread_count'])

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions