
Snapshot Testing JSON Output Without Flaky Failures
Snapshot tests for JSON in pytest with syrupy and Node's test runner: what a snapshot stores, why random ids break it, and matchers and scrubbing that fix it.
Tag
590 posts

Snapshot tests for JSON in pytest with syrupy and Node's test runner: what a snapshot stores, why random ids break it, and matchers and scrubbing that fix it.

Load a CSV from Cloud Storage into BigQuery with bq load: explicit schema, bad-record limits, quoted newlines, replace versus append and a job ID for reruns.

How to load CSV into BigQuery, Snowflake and ClickHouse: stage the file, declare the schema, pick an error policy, load once and check the counts afterward.

Turn a CSV into a browsable, searchable, filterable website with sqlite-utils and Datasette, with a JSON and CSV API, facets and full-text search built in.

Use Polars lazy scanning to filter and group a large CSV without loading it whole, set column types so zip codes stay text, and write Parquet as you go.

Export JSON Lines from a PostgreSQL query with row_to_json or to_jsonb and COPY TO STDOUT, handle quoting, types, nulls, large results and compression.

Connect Excel to PostgreSQL, MySQL and SQL Server with connectors and ODBC, using read only accounts, parameters, safe credentials, refresh and speed checks.

Keep Excel for reading and analysing database data through queries and refresh, and decide how writes should reach the database without losing rules.

Replace columns like Phone 1, Phone 2, Phone 3 from an Excel sheet with a child table: unpivot in SQL or pandas, drop blanks, add keys and check the counts.

Turn a wide Excel sheet into database tables: find the entities, choose keys, remove repeated groups and derived columns, and check the design with queries.

Move an Excel workbook into PostgreSQL: staging table, clean, normalized tables, constraints, roles, a verified load, and Excel as the read connection.

Move an Excel list into SQLite: clean it, design tables, load with Python, add constraints, query from Excel and know the limits for a small team.