Actual Behavior:
With dcp-cli version 3.0.5, the following valid command returns the error shown below:
$ hca dss post-search --replica aws --output-format raw --es-query "{}"
usage: hca dss post-search [-h] --es-query ES_QUERY [--output-format {summary,raw}] --replica {aws,gcp,azure} [--per-page PER_PAGE]
hca dss post-search: error: argument --output-format: invalid typing.Union[str, NoneType] value: 'raw'
Investigation Notes
Copied from Slack data-store-eng:
@akislyuk
@mbaumann, I took a look at your issue with running hca dss post-search --output-format raw. This is a bug in the Swagger client where it incorrectly passes the type for an optional parameter (expressed as typing.Optional[T] which is an alias for typing.Union[T, None]) as a type coercer callable to argparse - but calling typing.UnionT, None doesn't have the desired effect like T(input_param_value) does. Worse, there is no API to inspect typing.Union to see what it's a union of. So basically the typing module is a pain to work with. I'll have to find a workaround. Thanks for pointing out the problem.
in the meantime, you can still call the corresponding method from within Python.
Actual Behavior:
With dcp-cli version 3.0.5, the following valid command returns the error shown below:
Investigation Notes
Copied from Slack data-store-eng:
@akislyuk
@mbaumann, I took a look at your issue with running
hca dss post-search --output-format raw. This is a bug in the Swagger client where it incorrectly passes the type for an optional parameter (expressed as typing.Optional[T] which is an alias for typing.Union[T, None]) as a type coercer callable to argparse - but calling typing.UnionT, None doesn't have the desired effect like T(input_param_value) does. Worse, there is no API to inspect typing.Union to see what it's a union of. So basically the typing module is a pain to work with. I'll have to find a workaround. Thanks for pointing out the problem.in the meantime, you can still call the corresponding method from within Python.