committed 11:00PM - 05 Jul 26 UTC
- Read BSON (mongodump output) from any file source (file://, s3://, gs://,
sf…tp://) via a .bson/.bson.gz extension or a #bson hint, wired through the
existing format-reader registry (one entry, no per-source changes).
- Normalize BSON extended types to portable values before dlt sees them:
ObjectId/Decimal128 -> str, datetime/Timestamp -> UTC datetime, Regex ->
pattern, Binary -> base64 str, and DBRef/MinKey/MaxKey/Code -> Extended-JSON
shapes. Raw BSON objects (DBRef et al.) are not JSON-serializable and would
otherwise crash the load; Regex uses the raw pattern (no re.compile) so a
PCRE-only pattern in a valid dump does not crash the read.
- Keep BSON read-only: the file:// destination's write formats are unchanged,
so a .bson output target is still rejected.
- Self-contained normalization (no import of the pymongo-coupled Mongo source);
no new dependency, since bson ships with the existing pymongo dependency.