From 81b2cc1f3e44129a45d8d082ddcc179372f954c3 Mon Sep 17 00:00:00 2001 From: Owen Bodley Date: Sat, 19 Jul 2025 07:00:56 +0200 Subject: [PATCH] feat: support string entity ids, upgrade to SDK v3 --- examples/download_as_tsv.py | 2 +- examples/download_original_file.py | 2 +- examples/download_to_genbank.py | 2 +- examples/download_to_memory.py | 2 +- examples/upload_fasta.py | 2 +- examples/upload_tsv.py | 2 +- examples/workflows_example.py | 13 ++++++------- examples_test.py | 3 +-- requirements.txt | 2 +- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/examples/download_as_tsv.py b/examples/download_as_tsv.py index b14b720..eb90b07 100644 --- a/examples/download_as_tsv.py +++ b/examples/download_as_tsv.py @@ -2,7 +2,7 @@ from pipebio.pipebio_client import PipebioClient from pipebio.util import Util -document_id = int(os.environ['TARGET_DOCUMENT_ID']) +document_id = os.environ['TARGET_DOCUMENT_ID'] client = PipebioClient(url='https://app.pipebio.com') diff --git a/examples/download_original_file.py b/examples/download_original_file.py index 147bd9e..14be0a9 100644 --- a/examples/download_original_file.py +++ b/examples/download_original_file.py @@ -2,7 +2,7 @@ from pipebio.pipebio_client import PipebioClient from pipebio.util import Util -document_id = int(os.environ['TARGET_DOCUMENT_ID']) +document_id = os.environ['TARGET_DOCUMENT_ID'] client = PipebioClient(url='https://app.pipebio.com') diff --git a/examples/download_to_genbank.py b/examples/download_to_genbank.py index ebc04f9..61890c1 100644 --- a/examples/download_to_genbank.py +++ b/examples/download_to_genbank.py @@ -4,7 +4,7 @@ from pipebio.pipebio_client import PipebioClient from pipebio.util import Util -document_id = int(os.environ['TARGET_DOCUMENT_ID']) +document_id = os.environ['TARGET_DOCUMENT_ID'] client = PipebioClient(url='https://app.pipebio.com') diff --git a/examples/download_to_memory.py b/examples/download_to_memory.py index 215f31a..50e786e 100644 --- a/examples/download_to_memory.py +++ b/examples/download_to_memory.py @@ -1,7 +1,7 @@ import os from pipebio.pipebio_client import PipebioClient -document_id = int(os.environ['TARGET_DOCUMENT_ID']) +document_id = os.environ['TARGET_DOCUMENT_ID'] client = PipebioClient(url='https://app.pipebio.com') diff --git a/examples/upload_fasta.py b/examples/upload_fasta.py index f38a7d3..ae67160 100644 --- a/examples/upload_fasta.py +++ b/examples/upload_fasta.py @@ -4,7 +4,7 @@ from pipebio.pipebio_client import PipebioClient -folder_id = int(os.environ['TARGET_FOLDER_ID']) +folder_id = os.environ['TARGET_FOLDER_ID'] shareable_id = os.environ['TARGET_SHAREABLE_ID'] client = PipebioClient(url='https://app.pipebio.com') diff --git a/examples/upload_tsv.py b/examples/upload_tsv.py index eb4e108..1159682 100644 --- a/examples/upload_tsv.py +++ b/examples/upload_tsv.py @@ -10,7 +10,7 @@ from pipebio.pipebio_client import PipebioClient from pipebio.uploader import Uploader -folder_id = int(os.environ['TARGET_FOLDER_ID']) +folder_id = os.environ['TARGET_FOLDER_ID'] shareable_id = os.environ['TARGET_SHAREABLE_ID'] sequence_document_kind = SequenceDocumentKind.DNA diff --git a/examples/workflows_example.py b/examples/workflows_example.py index 7890d8f..b39711f 100644 --- a/examples/workflows_example.py +++ b/examples/workflows_example.py @@ -19,7 +19,7 @@ upload_jobs = client.upload_files( absolute_folder_path=os.path.join(dirname(getsourcefile(lambda: 0)), f'../sample_data/adimab/'), - parent_id=int(target_folder_id), + parent_id=target_folder_id, project_id=current_project_id, filename_pattern='.*\.fsa', poll_jobs=True @@ -32,13 +32,12 @@ # Create a folder to store the results of this workflow. workflow_folder = client.entities.create_folder( - current_project_id, - # NOTE: The parameters name & id are back to front. We'll fix that in an upcoming version. - target_folder_id, - 'Trial WF', + project_id=current_project_id, + name='Trial WF', + parent_id=target_folder_id, # Optionally hide the workflow results until the Workflow is done. - # While you're working on the workflow maybe it's best to show the folder. - True, + # While you're working on the workflow maybe it's best not to show the folder. + visible=True, ) workflow_folder_id = workflow_folder['id'] workflow_folder_name = workflow_folder['name'] diff --git a/examples_test.py b/examples_test.py index 591b0ef..33dad7e 100644 --- a/examples_test.py +++ b/examples_test.py @@ -70,7 +70,6 @@ def clean_up(): folder_id = os.environ['TARGET_FOLDER_ID'] entities = client.shareables.list_entities(shareable_id) target_folder = client.entities.get(folder_id) - entity_ids = list( - int(e['id']) for e in entities if e['path'].startswith(target_folder['path']) and e['id'] != folder_id) + entity_ids = list(e['id'] for e in entities if e['path'].startswith(target_folder['path']) and e['id'] != folder_id) if len(entity_ids): client.entities.delete(entity_ids) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index cc7bc3b..32c869e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -pipebio~=2.3.10 +pipebio~=3.0.0 pytest~=6.2.5 \ No newline at end of file