Releases: bruin-data/python-sdk
Releases · bruin-data/python-sdk
Release list
v0.5.2
What's new
- Microsoft Entra ID auth for Fabric connections — Fabric/MSSQL connections can now authenticate with a service principal (tenant ID, client ID, client secret) instead of only SQL logins.
- Apache 2.0 license — the SDK is now released under Apache 2.0.
Packaging
- The publish workflow now verifies the release tag matches the
versioninpyproject.tomland fails fast on drift. Thev0.5.1release hit this drift and never made it to PyPI, so 0.5.2 is the first release to carry the Entra ID change. - Fixed the README path used by the hatch build so the package renders its long description on PyPI.
v0.5.1: Merge pull request #7 from bruin-data/mssql-service-principal-auth
Support Microsoft Entra ID auth for Fabric connections
v0.5.0
What's new
- Add
start_timestamp,end_timestamp,execution_datetime,execution_timestampcontext properties - Add
commit_hashcontext property forBRUIN_COMMIT_HASHenv var
v0.4.0
What's Changed
- feat: Type-aware variable coercion using
BRUIN_VARS_SCHEMA— CLI string overrides (--var count=42) are now automatically coerced to their proper Python types (int, float, bool, list, dict) based on the pipeline's JSON Schema definitions - fix: Dropped Python 3.9 support, now requires Python >=3.10
- chore: Added CI workflow, ruff linting/formatting, Makefile, uv everywhere
- docs: Updated CONTRIBUTING.md with build instructions
v0.3.2
What's Changed
Replace SQL parsing with driver-native result detection — _execute() no longer uses regex to guess whether a SQL statement returns rows. Instead, it inspects each driver's native mechanism after execution:
- BigQuery:
job.result().schema - Snowflake:
cursor.description - DBAPI types (Postgres, MySQL, MSSQL, etc.):
cursor.description+cursor.fetchall() - DuckDB / MotherDuck:
result.description - Databricks:
cursor.description - ClickHouse:
result.column_names
Other changes
- Added integration tests for DuckDB, BigQuery, and Snowflake
- BigQuery integration tests support Application Default Credentials (ADC)
Full Changelog: v0.3.1...v0.3.2
v0.3.0
What's Changed
- feat: add Fabric, Oracle, DB2, HANA, Spanner, Vertica connections (v0.3.0) by @sabrikaragonen in #1
New Contributors
- @sabrikaragonen made their first contribution in #1
Full Changelog: v0.2.1...v0.3.0
v0.2.1
Improvements
- Added
__repr__toConnectionandGCPConnectionfor easier debugging>>> conn = get_connection("my_pg") >>> conn Connection(name='my_pg', type='postgres')
Stats
- Tests: 146 → 148
v0.2.0
bruin-sdk v0.2.0
New Connection Types
- Databricks
- ClickHouse
- Amazon Athena
- Trino
- SQLite
- MotherDuck
- Synapse (reuses MSSQL driver)
Auth Parity with Bruin CLI
- GCP: Application Default Credentials (ADC) support, alongside service account JSON
- Snowflake: Key-pair authentication support, alongside password auth
Improvements
- Connections are now context managers — use
with get_connection("x") as conn:for automatic cleanup Connection.query(sql)method for running queries directly on a connection object__version__attribute added to the package
Bug Fixes
- Fixed
GCPConnection.close()not actually closing the BigQuery client - Fixed
commit()being called on non-transactional databases (Athena, Trino) - Fixed
WITH ... INSERTCTE-based DML being misclassified as data-returning - Fixed ClickHouse
securefield type mismatch - Fixed potential
KeyErrorin Trino connection factory
Stats
- Tests: 100 → 146
- Supported connection types: 6 → 13
Install
pip install bruin-sdk==0.2.0v0.1.0
bruin-sdk v0.1.0 — Initial Release
The first release of the Bruin Python SDK, providing zero-boilerplate access to Bruin-managed connections and context.
Features
query(sql, connection)— Execute SQL against any Bruin-managed connection, returns a pandas DataFrameget_connection(name)— Get a connection object with a lazy-initialized database clientcontext— Access Bruin runtime context (dates, pipeline, asset name, variables)
Supported Connections
- Google Cloud Platform (BigQuery, via
GCPConnection) - Snowflake
- PostgreSQL
- Microsoft SQL Server
- MySQL
- DuckDB
Install
pip install bruin-sdkWith database extras:
pip install 'bruin-sdk[bigquery]'
pip install 'bruin-sdk[snowflake]'
pip install 'bruin-sdk[postgres]'