Skip to content

Releases: bruin-data/python-sdk

v0.5.2

Choose a tag to compare

@turtleDev turtleDev released this 14 Jul 08:32
868166c

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 version in pyproject.toml and fails fast on drift. The v0.5.1 release 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

Choose a tag to compare

@turtleDev turtleDev released this 10 Jul 08:44
58937fc
Support Microsoft Entra ID auth for Fabric connections

v0.5.0

Choose a tag to compare

@sabrikaragonen sabrikaragonen released this 16 Mar 11:56

What's new

  • Add start_timestamp, end_timestamp, execution_datetime, execution_timestamp context properties
  • Add commit_hash context property for BRUIN_COMMIT_HASH env var

v0.4.0

Choose a tag to compare

@sabrikaragonen sabrikaragonen released this 22 Feb 17:23

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

Choose a tag to compare

@sabrikaragonen sabrikaragonen released this 21 Feb 17:47

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

Choose a tag to compare

@github-actions github-actions released this 21 Feb 14:17

What's Changed

  • feat: add Fabric, Oracle, DB2, HANA, Spanner, Vertica connections (v0.3.0) by @sabrikaragonen in #1

New Contributors

Full Changelog: v0.2.1...v0.3.0

v0.2.1

Choose a tag to compare

@sabrikaragonen sabrikaragonen released this 21 Feb 12:09

Improvements

  • Added __repr__ to Connection and GCPConnection for easier debugging
    >>> conn = get_connection("my_pg")
    >>> conn
    Connection(name='my_pg', type='postgres')

Stats

  • Tests: 146 → 148

v0.2.0

Choose a tag to compare

@sabrikaragonen sabrikaragonen released this 21 Feb 12:02

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 ... INSERT CTE-based DML being misclassified as data-returning
  • Fixed ClickHouse secure field type mismatch
  • Fixed potential KeyError in Trino connection factory

Stats

  • Tests: 100 → 146
  • Supported connection types: 6 → 13

Install

pip install bruin-sdk==0.2.0

v0.1.0

Choose a tag to compare

@sabrikaragonen sabrikaragonen released this 21 Feb 12:02

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 DataFrame
  • get_connection(name) — Get a connection object with a lazy-initialized database client
  • context — 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-sdk

With database extras:

pip install 'bruin-sdk[bigquery]'
pip install 'bruin-sdk[snowflake]'
pip install 'bruin-sdk[postgres]'