Impl
pipelines.enrichment.tags.impl
Summary
Concrete tags-family implementations (dagpipe stage nodes + root).
Stage bodies are ports of domain/enrichment/tags/flags.py. The root
ImplTagsPipeline.enrich runs the hexa-wired stage graph through a dagpipe
Engine and delegates terminal processing to ImplTagsFinalizePort (port of
TagStatesProcessorAdaptor).
Classes
ImplEntityFlagsPort
Bases: EntityFlagsPort
Entity-flags stage: append entity_* flags from the entity name.
Attributes
config
property
Per-node config injected via set_config.
Returns:
| Type | Description |
|---|---|
|
dict | None: The per-node config, or None before injection. |
entity_based_flag_mapping
property
Entity name → flag mapping used for entity flagging.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
The entity-based flag mapping. |
Functions
resolve
Append matching entity_* flags and reset tags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Incoming state carrying |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
A fork with updated |
set_config
Inject the per-node config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
dict
|
Per-node config from the dagpipe spec. |
required |
set_registry
Inject the merged pattern registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
PatternRegistry
|
The merged pattern registry. |
required |
ImplSetTagsPort
Bases: SetTagsPort
Set-tags stage: emit tags from the matching flag rules.
Attributes
config
property
Per-node config injected via set_config.
Returns:
| Type | Description |
|---|---|
|
dict | None: The per-node config, or None before injection. |
flags_based_tags_rules
property
Flag-matching rules that emit tags.
Returns:
| Type | Description |
|---|---|
|
List[Dict]: The ordered tag rules. |
Functions
resolve
Append tags emitted by the first matching flag rules.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Incoming state carrying candidate flags and tags. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
A fork with |
set_config
Inject the per-node config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
dict
|
Per-node config from the dagpipe spec. |
required |
set_registry
Inject the merged pattern registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
PatternRegistry
|
The merged pattern registry. |
required |
ImplTagsFinalizePort
Bases: TagsFinalizePort
Finalize terminal states into the tags result dict.
Functions
process
Build the tags result dict, deduped and order-preserving.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
states |
List
|
Terminal states from the dagpipe graph. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
|
ImplTagsPipeline
Bases: TagsPipeline
Concrete tags pipeline root wiring the stage ports.
Attributes:
| Name | Type | Description |
|---|---|---|
amount_flags |
ImplAmountFlagsPort
|
Amount-flags stage port. |
entity_flags |
ImplEntityFlagsPort
|
Entity-flags stage port. |
set_tags |
ImplSetTagsPort
|
Set-tags stage port. |
finalize |
ImplTagsFinalizePort
|
Terminal finalize port. |
Functions
enrich
Run the tags graph on an entity payload and finalize the result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload |
dict
|
Payload carrying |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The tags result dict from the finalize port. |