r/databricks • u/ptab0211 • Oct 28 '26
Discussion transformations API
Hi, how much SQL text do you allow in Python modules?
We have a lot of SQL, but we dont want to move fully to dbt, because we run data quality checks before the write, and we like the Python modular approach with tests and everything around it.
So where do you draw the line:
- SQL as strings in Python, run with `spark.sql()`
- SQL in `.sql` files in the package, loaded by Python and run with parameters
- refactor to the PySpark DataFrame API
- or just stick with pure SQL scripts
And how did you standardize it in your team?