featureforge
featureforge copied to clipboard
in stats manager, booking_duration=None is not supported
This code from the documentation is not working because of this:
>>> from featureforge.experimentation.stats_manager import StatsManager
>>> sm = StatsManager(None, 'Your-database-name')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/francolq/.virtualenvs/lq-research/local/lib/python2.7/site-packages/featureforge/experimentation/stats_manager.py", line 62, in __init__
self.booking_delta = timedelta(seconds=booking_duration)
TypeError: unsupported type for timedelta seconds component: NoneType
Talking with @jmansilla we have decided to make a change in the StatsManager API.
Until now we have:
def __init__(self, booking_duration, db_name, db_uri=None, keep_running_on_errors=True)
The idea is move db_name in first place and make booking_duration optional with None as default value. If booking_duration is not provided, it will mean that the booking duration will not be take in count and the ticket cannot be stolen by other process.
Finally the new interface:
def __init__(self, db_name, booking_duration=None, db_uri=None, keep_running_on_errors=True)