human readable: clean output when there is no expand option
@@ -192,12 +192,13 @@ def get(ctx, asset_name, asset_key, expand, json_output, config, profile):
client = get_client(config, profile)
res = client.get(asset_name, asset_key)
+ def _get_asset_count(n, asset_type):
+ return f'{n} {asset_type}' if n == 1 else f'{n} {asset_type}s'
+
if asset_name == assets.DATASET:
if not expand:
- # remove datasamples associated with dataset
- # TODO becomes deprecated with the human readable view
- del res['trainDataSampleKeys']
- del res['testDataSampleKeys']
+ res['trainDataSampleKeys'] = _get_asset_count(len(res['trainDataSampleKeys']), 'data sample key')
+ res['testDataSampleKeys'] = _get_asset_count(len(res['testDataSampleKeys']), 'data sample key')
elif asset_name == assets.TRAINTUPLE:
if expand:
