Skip to content

Commit

Permalink
Added sanity check for Mturk sandbox testing
Browse files Browse the repository at this point in the history
  • Loading branch information
meta-paul committed Nov 16, 2023
1 parent b527961 commit c5c5bc0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion mephisto/abstractions/providers/mturk/mturk_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ def create_hit_type(
has_locale_qual = True
locale_requirements += existing_qualifications

if not has_locale_qual and not client_is_sandbox(client):
is_sandbox = client_is_sandbox(client)
if not has_locale_qual and not is_sandbox:
allowed_locales = get_config_arg("mturk", "allowed_locales")
if allowed_locales is None:
allowed_locales = [
Expand All @@ -458,6 +459,9 @@ def create_hit_type(
}
)

if is_sandbox:
hit_reward = 0

# Create the HIT type
response = client.create_hit_type(
AutoApprovalDelayInSeconds=auto_approve_delay,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def remove_participants_from_group(
Participant-Groups/paths/~1api~1v1~1participant-groups~1%7Bid%7D~1participants~1/delete
"""
from mephisto.utils.logger_core import get_logger

logger = get_logger(name=__name__)
endpoint = cls.list_participants_for_group_api_endpoint.format(id=id)
params = dict(participant_ids=participant_ids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ def _create_participant_group_with_qualified_workers(
return prolific_participant_group

def _get_excluded_participant_ids(self, task_run: "TaskRun") -> List[str]:
""" Find participant_ids that exceeded `maximum_units_per_worker` cap within this Task
"""
"""Find participant_ids that exceeded `maximum_units_per_worker` cap within this Task"""
task: "Task" = task_run.get_task()
task_units: List["Unit"] = self.db.find_units(task_id=task.db_id)

Expand Down

0 comments on commit c5c5bc0

Please sign in to comment.