dlt.extract.resource
with_table_name
def with_table_name(item: TDataItems, table_name: str) -> DataItemWithMeta
Marks item
to be dispatched to table table_name
when yielded from resource function.
with_hints
def with_hints(item: TDataItems,
hints: TResourceHints = None,
create_table_variant: bool = False) -> DataItemWithMeta
Marks item
to update the resource with specified hints
.
Will create a separate variant of hints for a table if name
is provided in hints
and create_table_variant
is set.
Create TResourceHints
with make_hints
.
Setting table_name
will dispatch the item
to a specified table, like with_table_name
DltResource Objects
class DltResource(Iterable[TDataItem], DltResourceHints)
Implements dlt resource. Contains a data pipe that wraps a generating item and table schema that can be adjusted
source_name
Name of the source that contains this instance of the source, set when added to DltResourcesDict
section
A config section name
SPEC
A SPEC that defines signature of callable(parametrized) resource/transformer
from_data
@classmethod
def from_data(cls,
data: Any,
name: str = None,
section: str = None,
hints: TResourceHints = None,
selected: bool = True,
data_from: Union["DltResource", Pipe] = None,
inject_config: bool = False) -> Self
Creates an instance of DltResource from compatible data
with a given name
and section
.
Internally (in the most common case) a new instance of Pipe with name
is created from data
and
optionally connected to an existing pipe from_data
to form a transformer (dependent resource).
If inject_config
is set to True and data is a callable, the callable is wrapped in incremental and config
injection wrappers.