Skip to content

Fix null safety in all semantic layer adapters#18

Merged
nicosuave merged 1 commit intomainfrom
nicosuave/adapter-null-safety
Dec 29, 2025
Merged

Fix null safety in all semantic layer adapters#18
nicosuave merged 1 commit intomainfrom
nicosuave/adapter-null-safety

Conversation

@nicosuave
Copy link
Copy Markdown
Member

Applies the same fix from the Cube adapter (#16) to all other semantic layer adapters.

Problem: When YAML has explicit empty sections like dimensions: with no value, it parses as None instead of a missing key. Using .get("key", []) returns None (not the default []), causing TypeError: 'NoneType' object is not iterable.

Fix: Change .get("key", []) to .get("key") or [] which handles both missing keys and explicit None values.

Affected adapters:

  • MetricFlow (dbt semantic layer)
  • LookML (Looker)
  • Hex
  • Sidemantic (native format)
  • Superset
  • Rill
  • Omni

All 196 adapter tests pass.

Change .get("key", []) to .get("key") or [] pattern across all adapters
to handle YAML files with explicit empty sections (key: with no value)
which parse as None instead of missing keys.

Affected adapters: MetricFlow, LookML, Hex, Sidemantic, Superset, Rill, Omni
@nicosuave nicosuave merged commit 22e335b into main Dec 29, 2025
10 checks passed
@nicosuave nicosuave deleted the nicosuave/adapter-null-safety branch December 29, 2025 18:30
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