[librecat-dev] Vacuum fix on keys?

Nicolas Franck Nicolas.Franck at UGent.be
Wed Sep 13 15:15:53 CEST 2023


The internal workings of the fix "vacuum" are correct: they clean
the values of a record. In your case the bad value is in the key,
not in the value. That cannot be fixed with "vacuum".

Having non sensical keys (like an empty string) is bad indeed, but that would
require another fix to make that behaviour explicit.

> On 13 Sep 2023, at 14:34, Peil, Vitali <vitali.peil at uni-bielefeld.de> wrote:
>
> Hi all,
>
> I came across some bad data ;-). Tried to fix this with the vacuum fix. The data I have includes empty field names which I want to clean.
>
> with the vacuum fix:
> $ echo '[{"ok": 1, "empty": "", "":"some bad data"}]' | catmandu convert to JSON --fix "vacuum()"
> Output: [{"":"some bad data","ok":1}]
>
> but I would expect as output
> [{"ok":1}]
>
> Is this a bug in the vacuum fix? Is there another way doing this?
>
> Best,
> Vitali
>
>
> _______________________________________________
> librecat-dev mailing list
> - send list mails to librecat-dev at lists.uni-bielefeld.de
> - to unsubscribe or change options, visit https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev
> - project website: http://librecat.org/




More information about the librecat-dev mailing list