umccr / libica

:snake: Python SDK for Illumina Connected Analytics (ICA) :dragon:
MIT License
6 stars 4 forks source link

Get Project Pipeline Configuration Parameters fails when default values are an integer #138

Closed alexiswl closed 3 months ago

alexiswl commented 5 months ago

Steps to reproduce

project_id = 'd3697f78-22b0-41e2-96f6-d105715239f3'
pipeline_id = '024dd8d0-6ff5-4641-a6e6-cc5c7d30e2e7'

with ApiClient(get_icav2_configuration()) as api_client:
    # Create an instance of the API class
    api_instance = ProjectPipelineApi(api_client)

try:
    # Retrieve input parameters for a project pipeline.
    api_response: PipelineConfigurationParameterList = api_instance.get_project_pipeline_configuration_parameters(
        project_id, pipeline_id
    )
except ApiException as e:
    logger.error("Exception when calling ProjectPipelineApi->get_project_pipeline_input_parameters: %s\n" % e)
    raise ApiException

Using the curl API I think this is the offending item:

{
      "code": "max_cpus",
      "required": false,
      "multiValue": false,
      "type": "integer",
      "settings": {
        "defaultValues": [
          16
        ]
      }
    }
victorskl commented 3 months ago

It should work, actually. For some reason, it didn't. It could be generator bug.

Meanwhile, you could turn off return type checking setting.

api_response: PipelineConfigurationParameterList = api_instance.get_project_pipeline_configuration_parameters(
    project_id=project_id,
    pipeline_id=pipeline_id,
    _check_return_type=False,
)

I have collected this in examples doc for future reference: https://github.com/umccr-illumina/libica/blob/main/examples/issue_138.py