Skip to content

Add Boring Semantic Layer (BSL) adapter#13

Merged
nicosuave merged 4 commits intomainfrom
bsl-adapter
Dec 24, 2025
Merged

Add Boring Semantic Layer (BSL) adapter#13
nicosuave merged 4 commits intomainfrom
bsl-adapter

Conversation

@nicosuave
Copy link
Copy Markdown
Member

Summary

  • Adds bidirectional adapter for Boring Semantic Layer, an Ibis-powered semantic layer with YAML configuration
  • Full roundtrip support: BSL -> Sidemantic -> BSL
  • Cross-format conversion: BSL <-> Cube, BSL <-> MetricFlow
  • Expression parser for Ibis-style syntax (_.column.sum(), _.count(), etc.)
  • Auto-detection in load_from_directory() for BSL files

Changes

  • sidemantic/adapters/bsl.py - Main adapter with parse/export
  • sidemantic/adapters/bsl_expr.py - Expression parser for BSL Ibis syntax
  • sidemantic/loaders.py - BSL auto-detection
  • docs/adapters.qmd - Documentation and compatibility table
  • README.md - Add BSL to formats list
  • Test fixtures and 65 tests covering parsing, export, roundtrip, and edge cases

Adds bidirectional adapter for BSL (https://github.com/boringdata/boring-semantic-layer),
an Ibis-powered semantic layer with YAML configuration.

Features:
- Parse BSL expressions: _.column, _.count(), _.column.sum(), _.column.year()
- Map BSL types to sidemantic: mean->avg, nunique->count_distinct
- Handle time dimensions with is_time_dimension and smallest_time_grain
- Support BSL joins with left_on/right_on syntax
- Detect calc measures (derived metrics)
- Full roundtrip: BSL -> Sidemantic -> BSL
- Cross-format conversion: BSL <-> Cube, BSL <-> MetricFlow

Files:
- sidemantic/adapters/bsl_expr.py: Expression parser
- sidemantic/adapters/bsl.py: Main adapter
- sidemantic/loaders.py: Auto-detection for BSL format
- tests/adapters/test_bsl.py: 55 unit tests
- tests/adapters/test_bsl_roundtrip.py: 10 roundtrip tests
- tests/fixtures/bsl/: Test fixtures
- README: Add BSL to formats list and adapters section
- docs/adapters.qmd: Add BSL to supported formats table, feature
  compatibility matrix, usage example with roundtrip export, and
  import mapping section
@nicosuave nicosuave merged commit ba6c866 into main Dec 24, 2025
10 checks passed
@nicosuave nicosuave deleted the bsl-adapter branch December 24, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant