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

Adds bonus history functionality to wrapper, increases page size #537

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

evankirkiles
Copy link
Contributor

The MTurk boto3 client has functionality for getting a list of all paid bonuses for a specified HIT or for a specified assignment id. I've implemented this over on my own dashboard and it's been really useful to our lab with keeping payments clear regarding who we've paid per hit, and how much––especially for experiments not run through PsiTurk. I assume it can't hurt to have the master amt_services_wrapper also have this functionality if someone wants to work with this in the future.

I also bumped up the page size so we don't need as many pagination requests to AWS.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 59.77% when pulling c24c656 on evankirkiles:evan_patches into bad1e5c on NYUCCL:master.

@@ -278,6 +278,15 @@ def post(self):
raise APIException(message='task name `{}` not recognized!'.format(data['name']))


class BonusList(Resource):
def post(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be GET, not POST? my understanding of rest apis is that post is reserved for creation of new records, and GET for retrieval.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about this for a bit, and it's very possible to make it into a GET request. However, we'd then be unable to query for multiple assignment IDs.

Actually, now that I think about it, I guess that that fits better with the MTurk boto3 client functionality itself. We'd just have to remove the multiple assignment ID workflows altogether. Will do when i find the time.

@deargle
Copy link
Collaborator

deargle commented Jan 5, 2022

Did you mean to also commit modifications to amt_services_wrapper.py? My intention was that no api calls touch amt_services.py directly, but rather, that they all go through _wrapper.py, which also exclusively handles any psiturk database work (IIRC). The shell also exclusively uses the wrapper.

@evankirkiles
Copy link
Contributor Author

Oh, yes, I forgot. I'll add a wrapper function, move all the multi-assignment-id calls out of amt_services.py and into the wrapper function, and then restrict the API to GET requests that can take either a HIT Id or a single Assignment Id.

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

3 participants