Is there a command in sql cell to ignore formatting for some lines like `# fmt: off` in Python cells
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 02:10 PM
In python cells I can add the comments `# fmt: off` before a block of code that I want black/autoformatter to ignore and `# fmt: on` afterwards. Is there anything similar I can put in sql cells to accomplish the same effect?
Some of the recommendations make the code far less legible.
Also is there any way to ignore single lines in the python cell?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 07:05 AM
The sql formatter I'm using is whatever databricks notebooks in the workspace themselves are using (with Ctrl-Shift-F). Is that link related to databricks?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 06:28 AM
I'll accept since it looks like the answer is a no for an ignore command in sql cells.
I found out that you can ignore single lines in python cells by putting `# fmt: skip` at the end. There has to be a space between the `#` and fmt or else you'll get a "AssertionError: INTERNAL ERROR: Black produced different code on the second pass of the formatter. Please report a bug on https://github.com/psf/black/issues." error

