
YAML Error Could Not Find Expected Colon and Its Causes
A line with a word and no colon makes the parser fail while scanning a simple key. See the message in three parsers, the usual causes and the fixes.
Tag
54 posts

A line with a word and no colon makes the parser fail while scanning a simple key. See the message in three parsers, the usual causes and the fixes.

Why a line indented between two levels raises did not find expected key, how PyYAML words it differently, and how to realign. Output from three parsers.

Which characters trigger this scanner error, a tab, at sign, backtick or percent sign, what each looks like in output and the fix that clears it.

Thirty six tiny CSV files that separate good readers from bad ones, with the right answer for each and the readers that missed it in my tests.

What mapping values are not allowed here means, three causes found in real files, an unquoted colon, a stray space and a double value, and the fix for each.

TSV avoids most quoting because tabs rarely appear in text, but there are three TSV dialects and they disagree. See where each breaks and which to pick.

Write CSV that survives every reader. Wrap fields with commas, quotes or line breaks, double inner quotes, and round trip test it against four readers.

A CSV stores text, so every reader infers types. Measure what inference costs in time and memory on 2 million rows, and what it breaks: ZIP codes and dates.

Find a file's delimiter in four steps, from looking at the bytes to a quote aware check, and see where Python, DuckDB and qsv sniffers disagree.

Set up PostgreSQL for development: choose native or Docker, pick a version, create a user, connect, find the config files and fix common errors.

A CSV has no flag that says whether row one is a header, so readers guess. Test four files, set the header explicitly, and handle duplicate names.

A CSV from Windows leaves an invisible carriage return on every last column. See it in a shell loop and MySQL, and fix it without damaging quoted fields.