← All updates Databricks Update One-Pager Light version
databricks Platform · Updated Sep 10, 2025

Python Custom Data Sources for Spark Declarative Pipelines

Enhance your data pipelines with custom Python data sources and sinks.

What it does

This update allows users to integrate Python custom data sources and sinks into Spark Declarative Pipelines on Lakeflow, enabling the creation of reusable data sources that can connect to various data systems. Users can implement custom data sources by subclassing the PySpark DataSource class and defining methods for reading and writing data. The feature supports batch and streaming data processing, enhancing the flexibility of data ingestion and output in Spark applications.

Why it matters

By enabling the use of custom Python data sources, organizations can streamline their data workflows, reduce the need for complex ETL processes, and leverage existing Python libraries for data manipulation. This capability enhances productivity for data engineers and data scientists, allowing them to focus on building robust data solutions rather than dealing with data integration challenges. It also supports a wider range of data sources, improving data accessibility and insights.

Key capabilities
Custom Data Source Integration
Integrate Python custom data sources and sinks into Spark Declarative Pipelines.
Batch and Streaming Support
Supports both batch and streaming data processing for flexible data handling.
Reusable Data Sources
Create reusable data sources that can connect to various data systems.
Enhanced Data Manipulation
Utilize Python libraries for advanced data manipulation and processing.
Prerequisites
Databricks Runtime 15.4 LTS or above
Serverless environment version 2
Recommended use cases
Building custom data ingestion pipelines from various sources.Creating reusable data sources for testing and development.Integrating with third-party APIs for real-time data processing.Generating synthetic data for testing purposes.
Limitations · remember
!User-defined data sources must be serializable as dictionaries.
!Only string fields are supported in certain examples.
Architecture
Lakeflow → Spark Declarative Pipelines → Python Custom Data Sources → Data Processing Layer
Get started
1
Implement Data Source
Create a subclass of the DataSource class to define your custom data source.
2
Register Data Source
Register your custom data source with the Spark session.
3
Load Data Source
Use the Spark read method to load data from your custom data source.
4
Define Schema
Specify the schema for the data source to ensure proper data handling.
Key takeaway
The ability to use Python custom data sources in Spark Declarative Pipelines significantly enhances data integration and processing capabilities.
2025-09-10-fa8b76f7 Generated by the Databricks Updates Agent · browse all updates