Skip to content

Commit cf2e65d

Browse files
authored
Add --data-type to upload CLI command (#168)
* add --data-type to upload cli * process-> data type * update readme * --process deprecated * oops its not a flag
1 parent ee3dbf7 commit cf2e65d

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Options:
5353
--name TEXT Name of the dataset
5454
--description TEXT Description of the dataset (optional)
5555
--project TEXT Name or ID of the project
56-
--process TEXT Name or ID of the ingest process
56+
--data-type TEXT Name or ID of the data type (ingest process)
5757
--data-directory TEXT Directory you wish to upload
5858
-i, --interactive Gather arguments interactively
5959
--help Show this message and exit.

cirro/cli/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def download(**kwargs):
5959
default='')
6060
@click.option('--project',
6161
help='Name or ID of the project')
62-
@click.option('--process',
63-
help='Name or ID of the ingest process')
62+
@click.option('--data-type', '--process',
63+
help='Name or ID of the data type (--process is deprecated)')
6464
@click.option('--data-directory',
6565
help='Directory you wish to upload')
6666
@click.option('-i', '--interactive',

cirro/cli/controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ def run_ingest(input_params: UploadArguments, interactive=False):
8282
directory = input_params['data_directory']
8383
else:
8484
input_params['project'] = get_id_from_name(projects, input_params['project'])
85-
input_params['process'] = get_id_from_name(processes, input_params['process'])
85+
input_params['data_type'] = get_id_from_name(processes, input_params['data_type'])
8686
directory = input_params['data_directory']
8787
files = get_files_in_directory(directory)
8888

8989
if len(files) == 0:
9090
raise InputError("No files to upload")
9191

92-
process = get_item_from_name_or_id(processes, input_params['process'])
92+
process = get_item_from_name_or_id(processes, input_params['data_type'])
9393
logger.info(f"Validating expected files: {process.name}")
9494
try:
9595
cirro.processes.check_dataset_files(process_id=process.id, files=files, directory=directory)

cirro/cli/interactive/upload_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def gather_upload_arguments(input_params: UploadArguments, projects: List[Projec
168168

169169
confirm_data_files(input_params['data_directory'], files)
170170

171-
input_params['process'] = ask_process(processes, input_params.get('process'))
171+
input_params['data_type'] = ask_process(processes, input_params.get('data_type'))
172172

173173
data_directory_name = Path(input_params['data_directory']).name
174174
default_name = input_params.get('name') or data_directory_name

cirro/cli/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class UploadArguments(TypedDict):
1212
name: str
1313
description: str
1414
project: str
15-
process: str
15+
data_type: str
1616
data_directory: str
1717
include_hidden: bool
1818
interactive: bool

0 commit comments

Comments
 (0)