LibreCat / Catmandu-SRU

Catmandu module for working with SRU data.
https://metacpan.org/release/Catmandu-SRU
5 stars 5 forks source link

remove_field fix breaks the importer in version 0.429 #48

Closed nics closed 3 years ago

nics commented 3 years ago

catmandu convert SRU --base http://sru.k10plus.de/gvk --recordSchema picaxml --parser picaxml --query 'pica.lrk=caj and pica.bib=0001 not pica.exk=anmeldung' --fix 'remove_field(record)'

Removing record doesn't work in 0.429 but works in Catmandu 1.10/Catmandu::SRU 0.422.

nics commented 3 years ago

This works though:

catmandu convert SRU --base http://sru.k10plus.de/gvk --recordSchema picaxml --parser picaxml --query 'pica.lrk=caj and pica.bib=0001 not pica.exk=anmeldung' to CSV --fix 'remove_field(record)'

But JSON hangs:

catmandu convert SRU --base http://sru.k10plus.de/gvk --recordSchema picaxml --parser picaxml --query 'pica.lrk=caj and pica.bib=0001 not pica.exk=anmeldung' to JSON --fix 'remove_field(record)'

And line delimited JSON doesn't:

catmandu convert SRU --base http://sru.k10plus.de/gvk --recordSchema picaxml --parser picaxml --query 'pica.lrk=caj and pica.bib=0001 not pica.exk=anmeldung' to JSON --line-delimited 1 --fix 'remove_field(record)

Prettified JSON also doesn't:

catmandu convert SRU --base http://sru.k10plus.de/gvk --recordSchema picaxml --parser picaxml --query 'pica.lrk=caj and pica.bib=0001 not pica.exk=anmeldung' to JSON --pretty 1 --fix 'remove_field(record)

So it's probably caused by Catmandu::Exporter::JSON?

nics commented 3 years ago

This has started working for me with the latest Catmandu, Catmandu::SRU and Catmandu::PICA so I'm closing the issue.