LibreCat / Catmandu

Catmandu - a data processing toolkit
https://librecat.org
176 stars 31 forks source link

fixes introduce a new key if the key is not found #5

Closed pietsch closed 11 years ago

pietsch commented 11 years ago

This shell command line works as expected, downcasing the value of the job feature:

$echo '{"job":"Artist"}' | catmandu data --fix 'downcase("job")'
{"job":"artist"}

When trying to fix the value of a non-existing feature, a new feature with this key and a null value is created:

$ echo '{"job":"Artist"}' | catmandu data --fix 'downcase("occupation")'
{"occupation":null,"job":"Artist"}

This is should not happen.

nics commented 11 years ago

fixed by 6716437391a069fc5015e76a70eace25071ab296

pietsch commented 11 years ago

My commit d0bdb8e adds two tests to t/Catmandu-Fix-downcase.t to make sure this issue does not creep back in. You never know.