Skip to content

fix: ship the blob example's sample data — and make BLOB ingestion actually work#343

Merged
divyasinghds merged 1 commit into
developfrom
fix/blob-example-sample-data
Jul 7, 2026
Merged

fix: ship the blob example's sample data — and make BLOB ingestion actually work#343
divyasinghds merged 1 commit into
developfrom
fix/blob-example-sample-data

Conversation

@LukasWodka

Copy link
Copy Markdown
Collaborator

Summary

Resolves Bugbot's remaining finding on #330 (missing blob_documents_sample.csv) — and the latent bug shipping the sample exposed: BLOB ingestion has never worked. SQLAlchemy wants bytes at bind time, CSV/JSON cells arrive as str, so every row into a BLOB/LONGBLOB column died with StatementError(TypeError) — invisible because nothing ever executed the documented workflow.

  • Sample shipped: 6 documents, 3 label classes, base64-ish payloads, JSON metadata
  • insert_batch: str → utf-8 bytes for BLOB/LONGBLOB/LargeBinary columns (covers CSV and JSON paths)
  • Guardrail test: every examples/** data path must exist in the repo — the dangling-example class can't recur
  • e2e on real MySQL: BLOB roundtrip from str cells

Proven end to end: the example itself executed against real MySQL + wire-level registration — 6 rows, 3 labels, 1 summary call, LONGBLOB bytes stored and read back.

Suite 1373 passed, 1 xfailed; e2e database file 9/9.

Refs #330 (last Bugbot thread resolvable on merge).

🤖 Generated with Claude Code

…tually work

Bugbot on #330 flagged that examples/blob_ingestor.py points at a sample
CSV that doesn't exist (examples/data/ wasn't in the repo at all).
Shipping the sample exposed the deeper bug: the example could NEVER have
run — BLOB/LONGBLOB columns raise StatementError(TypeError) on every
row, because SQLAlchemy wants bytes at bind time and CSV/JSON cells
arrive as str. The 'documented BLOB workflow' has been broken end to
end, invisible because nothing executed it.

- examples/data/blob_documents_sample.csv: 6 documents, 3 label classes
  (passes LabelDiversityValidator), base64-ish payloads, JSON metadata.
- database.insert_batch: str values bound to BLOB/LONGBLOB/LargeBinary
  columns are utf-8-encoded once, covering both ingestion paths.
- Guardrail test: every data path an example references must exist in
  the repo (this class of dangling-example can't recur).
- e2e (real MySQL): BLOB roundtrip from str cells → bytes back out.

Proven end to end: the example executed against real MySQL + wire-level
registration — 6 rows, 3 labels, 1 summary call, LONGBLOB payloads
stored.

Suite: 1373 passed, 1 xfailed; e2e 9/9 (database file).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@divyasinghds divyasinghds merged commit 67fbd38 into develop Jul 7, 2026
7 checks passed
@divyasinghds divyasinghds deleted the fix/blob-example-sample-data branch July 7, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants