Skip to main content
This guide helps you migrate existing pandas code to DataStore for better performance while maintaining compatibility.

The One-Line Migration

The simplest migration is changing your import:
That’s it! Most pandas code works unchanged.

Step-by-Step Migration

1

Install chDB

2

Change the Import

3

Test Your Code

Run your existing code. Most operations work unchanged:
4

Handle Any Differences

A few operations behave differently. See Key Differences below.

What Works Unchanged

Data Loading

Filtering

Selection

GroupBy and Aggregation

Sorting

String Operations

DateTime Operations

I/O Operations


Key Differences

  1. Lazy Evaluation

DataStore operations are lazy - they don’t execute until results are needed. pandas:
DataStore:

  1. Return Types

  1. No inplace Parameter

DataStore doesn’t support inplace=True. Always use the return value: pandas:
DataStore:

  1. Comparing DataStores

pandas doesn’t recognize DataStore objects, so use to_pandas() for comparison:

  1. Row Order

DataStore may not preserve row order for file sources (like SQL databases). Use explicit sorting:

Migration Patterns

Pattern 1: Read-Analyze-Write

Pattern 2: DataFrame with pandas Operations

If you need pandas-specific features, convert at the end:

Pattern 3: Mixed Workflow


Performance Comparison

DataStore is significantly faster for large datasets: Benchmark on 10M rows

Troubleshooting Migration

Issue: Operation Not Working

Some pandas operations may not be supported. Check:
  1. Is the operation in the compatibility list?
  2. Try converting to pandas first: ds.to_df().operation()

Issue: Different Results

Enable debug logging to understand what’s happening:

Issue: Slow Performance

Check your execution pattern:

Issue: Type Mismatches

DataStore may infer types differently:

Gradual Migration Strategy

Week 1: Test Compatibility

Week 2: Switch Simple Scripts

Start with scripts that:
  • Read large files
  • Do filtering and aggregation
  • Don’t use custom apply functions

Week 3: Handle Complex Cases

For scripts with custom functions:

Week 4: Full Migration

Switch all scripts to DataStore import.

FAQ

Can I use both pandas and DataStore?

Yes! Convert between them freely:

Will my tests still pass?

Most tests should pass. For comparison tests, convert to pandas:

Can I use DataStore in Jupyter?

Yes! DataStore works in Jupyter notebooks:

How do I report issues?

If you find compatibility issues, report them at: https://github.com/chdb-io/chdb/issues
Last modified on July 13, 2026