-
-
Notifications
You must be signed in to change notification settings - Fork 873
Closed
Labels
Description
Search before asking
- I searched the issues and found no similar issues.
What Happened
Sqlfluff does not correctly parse Databricks single-line magics (e.g., -- MAGIC %run ./Notebook
). These lines are not recognized as valid magics, leading to parsing errors or the magics being treated as standard comments or code.
Expected Behaviour
- Sqlfluff should recognize and correctly parse single-line magics in Databricks SQL files.
- Single-line magics should be treated as special segments, not as standard comments or code.
Observed Behaviour
When running sqlfluff on a Databricks SQL file containing single-line magics, those lines are not parsed as magics, which can cause parsing errors or incorrect linting.
How to reproduce
valid notebook, but not parsable:
-- Databricks notebook source
-- MAGIC %md
-- MAGIC # MarkDown Cell
-- COMMAND ----------
-- MAGIC %run ./Notebook
-- COMMAND ----------
SELECT a FROM b
Dialect
databricks
Version
3.4.1
Configuration
sqlfluff lint test.sql --dialect databricks --templater raw
Are you willing to work on and submit a PR to address the issue?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct