locked
Error passing bool/categorical parameter into web service RRS feed

  • Question

  • I am working on publishing a web service to produce a prediction based on a model.  One of my parameters is whether or not a given day is a holiday, which was a boolean (TRUE / FALSE) that was calculated during an R script.  When I preview the output of my input data, I see lowercase "true" and "false".  When I try to pass this into the web service, I get the following error.

    InputParseError: Parsing of input vector failed. Verify the input vector has the correct number of columns and data types. Additional details: Value "bool" is not defined in enum. Line 1, position 2167.., Error code: BadArgument, Http status code: 400, Request id: 338eb834-b195-4a09-b6b2-47a0b91e80f1, Timestamp: Fri, 23 Jan 2015 20:51:09 GMT

    I have tried passing in true, 1, TRUE.  

    Does anyone know how I can successfully pass in a value for this parameter to get the service to execute?

    Thanks,
    Jeff

    Friday, January 23, 2015 9:03 PM

Answers

  • Hi Jeff,

    Thanks a lot for getting back to us! Glad you had a workaround.

    We tried to repro this issue with categorical bool input parameters, and we verified this bug is already fixed and the fix is deployed to PROD (The fix might have gone to PROD after Jan.23 but now it should work).  Do you mind trying again on your end? Please let us know if you still see a problem,

    Thanks,

    Jing

    Thursday, February 12, 2015 7:03 PM

All replies

  • Hey Jeff,

    Our team is looking into it, sorry for the inconvenience.

    Regards,

    AK

    Saturday, January 24, 2015 12:25 AM
  • Hello Jeff,

    This is the error observed in our log:

    Code: InputParseError, Target: ClientID,Location,Procedure,Month,DayOfWeek,Holiday, Message: Parsing of input vector failed. Verify the input vector has the correct number of columns and data types. Additional details: Value "bool" is not defined in enum

    You have tried to pass "true"/"TRUE"/1 as input value for "Holiday" right? Do you mind sending us more information to help troubleshoot? I'd like to request 1) your sample R code  2) your sample input. Could you please send to my email address?

    Thanks

    Jing


    Tuesday, February 3, 2015 7:16 AM
  • Hello Jeff,

    We were wondering if you could help us provide more information to find and fix this issue. Can you please send your  1) your sample R code  2) your sample input? Please send to this email address?

    Thanks,

    Tuesday, February 10, 2015 3:39 AM
  • It has been sent to Jing.  Just as an update, I could not wait very long on an answer, so I had to update my script to return a numerical value instead of the boolean value.

    Boolean Version:

    isHoliday <- function(d)
    {
    	month <- format(dateAxis, format="%m");
    	day <- format(dateAxis, format="%d");
    	dayOfWeek <- format(dateAxis, format="%a")
    # Christmas
    	if (month == "12" && day == "25") {
    		return(T);
    #New Years
    	} else if (month == "1" && day == "1") {
    		return(T);
    #July 4
    	} else if (month == "7" && day == "4") {
    		return(T);
    #Labor day
    	} else if (month == "9" && day < "8" && dayOfWeek == "Monday") {
    		return(T);
    #Memorial Day
    	} else if (month == "5" && day > "24" && dayOfWeek == "Monday") {
    		return(T);
    	} 
    	
    	return(F);
    }

    Thanks,
    Jeff

    Tuesday, February 10, 2015 8:46 PM
  • Hi Jeff,

    Thanks a lot for getting back to us! Glad you had a workaround.

    We tried to repro this issue with categorical bool input parameters, and we verified this bug is already fixed and the fix is deployed to PROD (The fix might have gone to PROD after Jan.23 but now it should work).  Do you mind trying again on your end? Please let us know if you still see a problem,

    Thanks,

    Jing

    Thursday, February 12, 2015 7:03 PM