Unusually large number of results returned by a fetch-data command
I used a carto-data command like cartodata fetch-data -s LRI -f 2010 -t 2012
for the ProgressiVis
project and found that the fetch command returned an unusually large number of results.
After analysis, I guess there are 2 anomalies:
- the
LRI
structure is not recognized when it should be - an unrecognized structure is silently ignored.
As a result, the generated http
request contains no filter involving the structure.
I think the 1st problem is due to this test on line 157: https://gitlab.inria.fr/cartolabe/cartolabe-data/-/blob/master/cartodata/command_line.py?ref_type=heads#L157
which should use struct.lower()
instead of struct
.
As for the 2nd problem, it's the absence of an else
branch triggering an error in the same test.
PS:
One last detail: testing in this way if a_key in a_dict.keys():
is inefficient because it involves a sequential search in a sequence of keys. It is recommended to write if a_key in a_dict:
for a direct access via the dictionary hash table.