Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local sixpack #6

Closed
wants to merge 27 commits into from
Closed

local sixpack #6

wants to merge 27 commits into from

Conversation

maurerbot
Copy link

except RequestException as e:
logger.exception("Error while trying to .convert: {err}".format(err=e))
logger.exception("Error while trying to .convert: %s" % e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to comply with landscape. I'm going to revert and ignore.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting - reading the comment in landscape, I agree with it. What it's saying, though, is that you should do logger.exception("Error while trying to .convert: %s", e).

Both the original and this change unconditionally do the substitution, but doing it like I have here only does the substitution if the logging is actually needed, for a minor performance improvement.

correct issues

prefetch not force

fix test

docs

docs

better doc
@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 2884d14 on waveaccounting:local into 3b2c49d on waveaccounting:master.

@maurerbot
Copy link
Author

v1.1.1 of sixpack-py will be tagged Monday

Tracking Locally
-----------------

By passing in the argument `local` in the SixpackTest constructor you can telldjango-sixpack to create a convertable db record for each participant.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a space after tell.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convertible

@@ -5,6 +5,8 @@
from django.conf import settings
from requests.exceptions import RequestException

from .models import SixpackParticipant

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per "Writing Idiomatic Python", we prefer using absolute imports to relative imports.

if self.local:
try:
participant = SixpackParticipant.objects.get(unique_attr=self.client_id, experiment_name=experiment_name)
participant.convert = True

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move lines 114 and 115 into an else.

Tracking Locally
-----------------

By passing in the argument `local` in the SixpackTest constructor you can tell django-sixpack to create a convertible db record for each participant.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add docs about why you'd want to do this/use cases for this? I get that it's creating a record in the DB, but not why I'd like to do that.


class SixpackParticipant(models.Model):
"""
A model that contains fields relating to a sixpack experiment participant.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you either make a more fulsome docstring (what do each field mean?), or drop this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes


try:
resp = session.participate(experiment_name, self.alternatives, force)
resp = session.participate(experiment_name, self.alternatives, force=force, prefetch=prefetch)
except RequestException:
logger.exception("Error while trying to .participate")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're in here, please make the quotation use consistent.

@squishybear-zz
Copy link

LGTM

@landscape-bot
Copy link

Code Health
Repository health decreased by 4% when pulling 2b727af on local into 3b2c49d on master.

@landscape-bot
Copy link

Code Health
Repository health decreased by 5% when pulling 506cabc on local into 3b2c49d on master.

@ashchristopher
Copy link
Contributor

@dlanger @adrianmaurer - re: South - this could be a bit tricky - grab me first thing in the morning and we can go over it. The short of it is, you will need to make South==1.0.0 a requirement of this package.

@maurerbot
Copy link
Author

right, south isn't included by default in 1.5.

@landscape-bot
Copy link

Code Health
Repository health decreased by 4% when pulling 4437405 on local into 3b2c49d on master.

@landscape-bot
Copy link

Code Health
Repository health decreased by 4% when pulling 3640bd9 on local into 3b2c49d on master.

@landscape-bot
Copy link

Code Health
Repository health decreased by 4% when pulling 98370e3 on local into 3b2c49d on master.


experiment = ButtonColorTest(local=True)

You may also choose to track only locally by passing in `sixpack=False` to the test constructor.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description doesn't match the sample code on line 106.

@landscape-bot
Copy link

Code Health
Repository health decreased by 4% when pulling 9a2aca3 on local into 3b2c49d on master.

@landscape-bot
Copy link

Code Health
Repository health decreased by 4% when pulling d7b91a5 on local into 3b2c49d on master.

@landscape-bot
Copy link

Code Health
Repository health decreased by 4% when pulling ac35d07 on local into 3b2c49d on master.

@mwarkentin
Copy link

Closing as stale.

@mwarkentin mwarkentin closed this Sep 16, 2019
@mwarkentin mwarkentin deleted the local branch September 16, 2019 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants