外部条件梳理
原能力
将行业、政策与市场变化关联到受影响的流程、资源和主体。(细化版 p.8–9)
首选项目
dlt(Apache-2.0(开源库))。 dlt
匹配范围
采集并登记外部政策/市场资料及元数据。
源码
dlt · class Incremental(
dlt/extract/incremental/__init__.py · 99–112 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
class Incremental(
ItemTransform[TDataItem, IncrementalCustomMetrics], BaseConfiguration, Generic[TCursorValue]
):
"""Adds incremental extraction for a resource by storing a cursor value in persistent state.
The cursor could for example be a timestamp for when the record was created and you can use this to load only
new records created since the last run of the pipeline.
To use this the resource function should have an argument either type annotated with `Incremental` or a default `Incremental` instance.
For example:
>>> @dlt.resource(primary_key='id')
>>> def some_data(created_at=dlt.sources.incremental('created_at', '2023-01-01T00:00:00Z'):
>>> yield from request_data(created_after=created_at.last_value)
实现与验收要点
适用日期、证据确认、关联受影响业务和识别变更。