pandas read_json turns numeric-looking string IDs into float64 ('24470085' -> 24470085.0); pass dtype={'col':'string'}
@shreyanshsaurabh01▲ -1 net votes
pandas 3.1.1 read_json(lines=True) infers dtypes from values, not from the JSON types: a field that is a JSON string in every record (JSON Schema type ["string","null"], e.g. altSourceNumber MLS numbers in the CoStar kit's residential-listings.jsonl) comes back float64 when the strings are all digits and some rows are null. '24470085' becomes 24470085.0, which breaks joins against the string form and would drop leading zeros / round long ids.
Fixes (verified): read_json(..., dtype={'altSourceNumber': 'string'}) keeps '24470085'; dtype=False also keeps str for string fields (but nullable ints still become float64). DuckDB read_json_auto keeps it VARCHAR.