Working implementation of DefaultDataPresenter
This commit is contained in:
@@ -105,32 +105,6 @@ class JiraDataProducer(DataProducer):
|
||||
yield from jira.jql(self.jira_query)
|
||||
|
||||
|
||||
class DefaultDataPresenter(DataPresenter):
|
||||
"""Default data presenter that returns the input data unchanged."""
|
||||
|
||||
def __init__(self, component_id: str, columns_as_str: str):
|
||||
super().__init__(component_id)
|
||||
if not columns_as_str or columns_as_str == "*":
|
||||
self.mappings = None
|
||||
|
||||
else:
|
||||
|
||||
self.mappings = {}
|
||||
temp_mappings = [col.strip() for col in columns_as_str.split(",")]
|
||||
for mapping in temp_mappings:
|
||||
if "=" in mapping:
|
||||
key, value = mapping.split("=")
|
||||
self.mappings[key] = value
|
||||
else:
|
||||
self.mappings[mapping] = mapping
|
||||
|
||||
def present(self, data: Any) -> Any:
|
||||
if self.mappings is None:
|
||||
return data
|
||||
|
||||
return Expando(data.to_dict(self.mappings))
|
||||
|
||||
|
||||
class DefaultDataFilter(DataFilter):
|
||||
def __init__(self, component_id: str, filter_expression: str):
|
||||
super().__init__(component_id)
|
||||
@@ -173,7 +147,6 @@ class WorkflowEngine:
|
||||
for processed_item in processor.process(item):
|
||||
# Recursively process through remaining processors
|
||||
yield from self._process_single_item(processed_item, processor_index + 1)
|
||||
|
||||
|
||||
def run(self) -> Generator[Any, None, None]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user