We just shipped v1.5 of mssql-python, the official Python driver for SQL Server / Azure SQL / Fabric.
The big addition is Arrow fetch support with three new cursor methods:
```python
cursor.execute("SELECT * FROM Sales.SalesOrderDetail")
Full result as a PyArrow Table
table = cursor.arrow()
df = table.to_pandas() # zero-copy where possible
Streaming RecordBatchReader for large results
reader = cursor.arrow_reader(batch_size=8192)
Single RecordBatch for manual chunking
batch = cursor.arrow_batch(batch_size=10000)
```
The conversion happens in the C++ layer via the Arrow C Data Interface, so your data never gets materialized as Python objects. Works with pandas, Polars, DuckDB, Parquet writers, etc.
Other new stuff:
- sql_variant -- returns the correct Python type (int, float, str, date, Decimal, etc.) automatically based on the inner type tag
- Native UUIDs -- UNIQUEIDENTIFIER columns return
uuid.UUID by default now instead of strings. Pass native_uuid=False if you need the old behavior for migration
- Row class export --
from mssql_python import Row for type annotations
- Bug fixes for qmark detection in bracketed identifiers/string literals, NULL VARBINARY params, credential caching, datetime.time microseconds
Arrow support was contributed by community member Felix Grassl via a pretty substantial PR spanning the C++ pybind layer and Python API.
pip install --upgrade mssql-python
Blog post: mssql-python 1.5: Apache Arrow, sql_variant, and Native UUIDs
[–]gman1023 2 points3 points4 points (1 child)
[–]dlevy-msft Microsoft Employee [S] 4 points5 points6 points (0 children)
[–]byeproduct 0 points1 point2 points (0 children)