[Python] How to correctly pass boolean parameters as strings to AnalysisParameterInput in...

Discussão em 'Python' iniciado por Stack, Abril 9, 2025.

  1. Stack

    Stack Membro Participativo

    Here’s the relevant part of my code:

    for key, value in param_inputs.items(): # Convert boolean strings or actual booleans to string format "True"/"False" if isinstance(value, bool): value_str = str(value) # True -> "True", False -> "False" elif isinstance(value, str) and value.lower() in ["true", "false"]: value_str = value.capitalize() # "true" -> "True", "false" -> "False" else: value_str = str(value) # leave other values as-is print(f"Adding parameter: {key} = {value_str}") param_inputs_list.append(AnalysisParameterInput(parameter_code=key, value=value_str))

    libica.openapi.v2.exceptions.ApiTypeError: Invalid type for variable 'value'. Required value type is one of [NoneType, str] and passed type was bool at ['value']

    I'm using the libica.openapi.v2 Python client to submit a Nextflow pipeline on ICA (Illumina's Interactive Cloud Analysis platform). In my function, I construct parameter inputs dynamically and pass them to the AnalysisParameterInput class.

    Continue reading...

Compartilhe esta Página