MemoryDataSource
laktory.models.datasources.MemoryDataSource
ยค
Bases: BaseDataSource
Data source using in-memory DataFrame, generally used in the context of a data pipeline.
ATTRIBUTE | DESCRIPTION |
---|---|
df |
Input DataFrame
TYPE:
|
Examples:
from laktory import models
import pandas as pd
df = spark.createDataFrame(
pd.DataFrame(
{
"symbol": ["AAPL", "GOOGL"],
"price": [200.0, 205.0],
"tstamp": ["2023-09-01", "2023-09-01"],
}
)
)
source = models.MemoryDataSource(
df=df,
as_stream=False,
)
df = source.read()