# Safe-DS: A Domain Specific Language to Make Data Science Safe

**Authors:** Lars Reimann, G\"unter Kniesel-W\"unsche

arXiv: 2302.14548 · 2023-04-10

## TL;DR

Safe-DS is a domain-specific language that enhances the safety and reliability of data science pipelines written in Python by enabling static type checking, range validation, and graphical development tools.

## Contribution

It introduces Safe-DS, a DSL that integrates with Python libraries, providing advanced static analysis and a graphical interface to improve data science pipeline safety.

## Key findings

- Detects type errors, range violations, and call order issues
- Automatically generates stubs from Python libraries
- Provides a synchronized textual and graphical development environment

## Abstract

Due to the long runtime of Data Science (DS) pipelines, even small programming mistakes can be very costly, if they are not detected statically. However, even basic static type checking of DS pipelines is difficult because most are written in Python. Static typing is available in Python only via external linters. These require static type annotations for parameters or results of functions, which many DS libraries do not provide. In this paper, we show how the wealth of Python DS libraries can be used in a statically safe way via Safe-DS, a domain specific language (DSL) for DS. Safe-DS catches conventional type errors plus errors related to range restrictions, data manipulation, and call order of functions, going well beyond the abilities of current Python linters. Python libraries are integrated into Safe-DS via a stub language for specifying the interface of its declarations, and an API-Editor that is able to extract type information from the code and documentation of Python libraries, and automatically generate suitable stubs.   Moreover, Safe-DS complements textual DS pipelines with a graphical representation that eases safe development by preventing syntax errors. The seamless synchronization of textual and graphic view lets developers always choose the one best suited for their skills and current task. We think that Safe-DS can make DS development easier, faster, and more reliable, significantly reducing development costs.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/2302.14548/full.md

## Figures

5 figures with captions in the complete paper: https://tomesphere.com/paper/2302.14548/full.md

## References

38 references — full list in the complete paper: https://tomesphere.com/paper/2302.14548/full.md

---
Source: https://tomesphere.com/paper/2302.14548