Git Product home page Git Product logo

Comments (6)

tylerburleigh avatar tylerburleigh commented on May 26, 2024

Thanks for catching that @claravdw. It looks like when I rewrote the CreateHIT function in version 0.4.2, I forgot to also rewrite some parts of GenerateQualificationRequirement(). I just committed version 0.6.0 that should fix the issue, can you try that?

from pymturkr.

claravdw avatar claravdw commented on May 26, 2024

Thanks! I get a different error now:


> packageVersion("pyMTurkR")
[1] ‘0.6.0’
> #make qual.req using example code
> quals.list <- list(
+     list(QualificationTypeId = "2F1KVCNHMVHV8E9PBUB2A4J79LU20F",
+          Comparator = "Exists",
+          IntegerValues = 1,
+          RequiredToPreview = TRUE
+     ),
+     list(QualificationTypeId = "00000000000000000071",
+          Comparator = "EqualTo",
+          LocaleValues = list(Country = "US"),
+          RequiredToPreview = TRUE
+     )
+ )
> GenerateQualificationRequirement(quals.list) -> qual.req
Error in GenerateQualificationRequirement(quals.list) : 
  object 'qualid' not found

from pymturkr.

tylerburleigh avatar tylerburleigh commented on May 26, 2024

Ah, I see what happened. Can you try 0.6.1 now?

from pymturkr.

claravdw avatar claravdw commented on May 26, 2024

Thanks for addressing this so quickly, Tyler! It works with the example code, my only problem now is when I try to add a minimum HITs approved qualification requirement:


quals.list <- list(
    list(QualificationTypeId = "000000000000000000L0",
         Comparator = "GreaterThan",
         IntegerValues = 80,
         RequiredToPreview = TRUE
    )
)
GenerateQualificationRequirement(quals.list) -> qual.req
hit <-CreateHIT(title = "Get qualified to label radio fragments about climate change",
                 description = "Classify a political radio fragment, and get qualified for more",
                 reward = ".20",
                 annotation = "Clim Coding Step 1b",
                 assignments = 100,
                 duration = MTurkR::seconds(hours=1),
                 expiration = MTurkR::seconds(days = 7),
                 question = q$string,
                 qual.req = qual.req
)
Error in py_call_impl(callable, dots$args, dots$keywords) : 
  ParamValidationError: Parameter validation failed:
Invalid type for parameter QualificationRequirements[0].IntegerValues, value: 80.0, type: <class 'float'>, valid types: <class 'list'>, <class 'tuple'>

Detailed traceback: 
  File "/nfs/home/C/claravandeweerdt/.local/lib/python3.6/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/nfs/home/C/claravandeweerdt/.local/lib/python3.6/site-packages/botocore/client.py", line 634, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/nfs/home/C/claravandeweerdt/.local/lib/python3.6/site-packages/botocore/client.py", line 682, in _convert_to_request_dict
    api_params, operation_model)
  File "/nfs/home/C/claravandeweerdt/.local/lib/python3.6/site-packages/botocore/validate.py", line 297, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())

Warning message:
In CreateHIT(title = "Get qualified to label radio fragments about climate change",  :
  Invalid Request

I thought setting the limit to as.integer(80) might solve the problem, but it didn't. Thanks again!

Clara

from pymturkr.

tylerburleigh avatar tylerburleigh commented on May 26, 2024

Good catch. Try version 0.6.2 and see if that fixes it?

Setting as.integer() in your call to the function was not a bad idea. The solution was basically that, but at the stage where IntegerValues were being put into the object.

from pymturkr.

claravdw avatar claravdw commented on May 26, 2024

Works like a charm, thank you!

from pymturkr.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.