Migrate-Anything
PYTHON SUBCLASS GUARD · TYPE SAFETY

Boolean vs Integer Strict Guard in CSV & JSON Migration

In Python, bool is a subclass of int (isinstance(True, int) == True). Combined with CSV tools that coerce "0" and "1" counts into booleans, migrations routinely corrupt small integer counters or collapse flags into integers.

Strict Type Separation Matrix

Input Column SampleNaive Inference BugMigrate-Anything Rule
is_active: ["true", "false"] SQLite round-trips as 0/1 integer, breaking Postgres BOOLEAN import. Inferred as bool; hashed as {"t":"bool","v":true}.
retry_count: ["0", "1", "0"] Coerced to bool when sample lacks values >= 2. Kept strictly as int unless schema explicitly declares boolean affinity.
mixed: ["true", "1"] Silently drops type distinction. Emits boolean_vs_int_strict_guard warning in dry-run report.

Inspect Strict Type Separation via /v1/infer-schema

curl -sS -X POST https://migrate.fastmesh.dev/v1/infer-schema \
  -H "Content-Type: application/json" \
  -d '{
    "source_format": "csv",
    "target_format": "postgres_ddl",
    "table_name": "type_guard_check",
    "source_data": "id,is_active,retry_count\n1,true,1\n2,false,0"
  }'
Verify bool vs int separation in 5 seconds
Zero data retention. Invalid requests return HTTP 422 ($0 charged).
Open 5s Try-Now Sandbox