Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): stabilize config command #910

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

nwagner84
Copy link
Member

No description provided.

@nwagner84 nwagner84 added C-enhancement Category: enhancement A-config Area: The config command labels Feb 14, 2025
@nwagner84 nwagner84 added this to the v1.1.0 milestone Feb 14, 2025
@nwagner84 nwagner84 self-assigned this Feb 14, 2025
Copy link

@mschumac mschumac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich habe das Kommando folgendermaßen erfolgreich getestet:

# Option skip-invalid

pica select -u "[email protected]" DUMP.dat.gz 
# error: parse erorr: invalid record on line ...

pica config skip-invalid true
pica select -u "[email protected]" DUMP.dat.gz
# läuft durch, natürlich leer, da es [email protected] nicht gibt

pica config --unset skip-invalid
pica select -u "[email protected]" DUMP.dat.gz
# error: parse erorr: invalid record on line ...

#################################################

# Option normalization

pica select "[email protected], 021A.a" DUMP1.dat
# 1352397544,Die @Heinzels - Neue Mützen neue Mission (Das Original-Hörspiel zum Kinofilm)

pica select "[email protected]" --where "021A.a =? 'Mützen'" DUMP1.dat
# leer

pica config normalization nfd
pica select "[email protected]" --where "021A.a =? 'Mützen'" DUMP1.dat
# 1352397544

pica config --unset normalization
pica select "[email protected]" --where "021A.a =? 'Mützen'" DUMP1.dat
# leer

Die Einstellung von skip-invalid und normalization ist sehr praktisch. Bei der Gelegenheit bitte den Schreibfehler in der Meldung "error: parse erorr: invalid record on line ..." ändern.

In der config.qmd bitte ich noch den Rechtschreibfehler "Unicode Normalform" in den Zeilen 33, 35 und 52 zu "Unicode-Normalform" zu verbessern. Zusammengesetzte Substantive werden schließlich nicht durch Leerzeichen getrennt.

Signed-off-by: Nico Wagner <[email protected]>
Signed-off-by: Nico Wagner <[email protected]>
@nwagner84 nwagner84 requested a review from mschumac February 17, 2025 09:19
@nwagner84
Copy link
Member Author

Lieber @mschumac,

danke für das Review. Die Schreibfehler sind korrigiert und werden mit diesem PR in den main-Branch gemerged. Noch ein Hinweis zum Testen der skip-invalid-Option: Diese bezieht sich auf Datensätze in der Eingabe, die nicht dekodiert werden können. Nachstellen ließe sich das wie folgt (out.dat ist eine gültige Eingabedatei):

$ echo "foobar" > invalid.dat

$ pica config skip-invalid true
$ pica count --records out.dat invalid.dat
215

$ pica config skip-invalid false
$ pica count --records out.dat invalid.dat
error: parse erorr: invalid record on line 1 (invalid.dat).

$ pica config --unset skip-invalid
$ pica count --records out.dat invalid.dat
error: parse erorr: invalid record on line 1 (invalid.dat).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config Area: The config command C-enhancement Category: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants