What are Data Sources?
Data sources are named connections to external data storage systems. Once configured, they can be automatically injected into your functions as Daft DataFrames.Quick Start
1. Create a Data Source
In the Daft Cloud dashboard:- Navigate to Data Sources in your project sidebar
- Click Create data source
- Select your source type
- Enter a name like
sales_data - Configure the connection (bucket, paths, credentials)
- Click Create
2. Use It in Your Code
Reference the data source using a type annotation:3. Create a Run
When creating a run in the dashboard, map your function parameters to data sources using keyword arguments:- Select the Function entrypoint type
- Enter your file path and function name (e.g.,
my_script.py:process_sales) - In the Keyword Arguments section, add an argument where:
- The key matches your function parameter name (e.g.,
sales_data) - The value is your configured data source name
- The key matches your function parameter name (e.g.,
- Click Create
How Injection Works
Daft Cloud uses type annotations to inject data sources:- Annotate a parameter with
daft.DataFrame - Map the parameter to a data source when creating a run
- At runtime, the system:
- Fetches the data source configuration
- Loads credentials from your project secrets
- Creates a Daft DataFrame pointing to your data
- Passes it to your function