Saving a Batch via Python API | simon buckner | 2017-02-20 12:50 |
Status: Closed | ||
Issue: When using the Labkey Python API, I am unable to save a batch, although I am able via the UI. The API follows a different flow that does not seem to be preserving uploaded data. I downloaded the Python API from here: https://github.com/LabKey/labkey-api-python, and based my script off of this sample: https://github.com/LabKey/labkey-api-python/blob/master/samples/save_batch_example.py I noticed that the flow for the save_batch() API call begins at SaveAssayBatchAction.java:executeAction(), whereas the UI upload is directed to UploadWizardAction.java:saveExperimentRun(). When uploading from the UI, the batch saves just fine. When uploading from the API, it makes it to TsvDataExchangeHandler.java:_writeRunData(). This line: dataFiles.addAll(context.getUploadedData().values()); ...seems to be giving me trouble. From the UI, the context variable is an instance of AssayRunUploadContext, and uploadedData is an ArrayList<File>. When using the Python API, context is an instance of ModuleRunUploadForm, and uploadedData is an ArrayList<JSONObject>. This does not seem to be valid somewhere in the code, as Python returns the error: labkey.exceptions.RequestError: '400: runDataUploadedFile not found in assay run properties.' The uploaded file property is not being set because the uploadedData field is not found/recognized in the context object. Is this a known issue? If not, is there anything about the Python API I am missing? Thanks, Simon |
||