Example
How data is passed to other blocks
The object that is returned from the decorated function (e.g.load_data_from_api)
will be made available in all blocks that depend on this block.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Write your code for fetching data from a remote source or loading it from disk.
import io
import pandas as pd
import requests
@data_loader
def load_data_from_api(*args, **kwargs):
url = 'https://raw.githubusercontent.com/mage-ai/datasets/master/restaurant_user_transactions.csv'
response = requests.get(url)
return pd.read_csv(io.StringIO(response.text), sep=',')
load_data_from_api)
will be made available in all blocks that depend on this block.
Was this page helpful?