Skip to content

Commit

Permalink
try to more gracefully handle the unlikely event that none of the des…
Browse files Browse the repository at this point in the history
…ired columns are available
  • Loading branch information
AMA-AC authored and mergify[bot] committed Dec 11, 2019
1 parent db188d9 commit bdf4599
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions datacube/scripts/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ def _write_tab(products):
'gqa_iterative_stddev_xy', 'time', 'sat_row',
'orbit', 'gqa', 'instrument', 'gqa_abs_xy', 'crs',
'resolution', 'tile_size', 'spatial_dimensions')

echo(df.to_string(columns=[col for col in output_columns if col in df.columns],justify='left',index=False))
# If the intersection of desired columns with available columns is empty, just use whatever IS in df
output_columns=tuple(col for col in output_columns if col in df.columns) or df.columns
echo(df.to_string(columns=output_columns,justify='left',index=False))


def _default_lister(products):
Expand Down

0 comments on commit bdf4599

Please sign in to comment.