fix: ignore emoji in XML upload processing
This commit is contained in:
1 parent
53d26a7b28
commit
5ecd571e3b
24 files changed
+5845
-36
No files matched your search
@@ -18,6 +18,7 @@ class LocalProcessingOutput:
|
||||
business_date: Optional[date]
|
||||
artifacts: Mapping[str, Path]
|
||||
exit_code: int
|
||||
ignored_emoji_count: int = 0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -185,8 +186,23 @@ class LocalDailyProcessor:
|
||||
business_date=business_date,
|
||||
artifacts=artifacts,
|
||||
exit_code=completed.returncode,
|
||||
ignored_emoji_count=self._ignored_emoji_count(result),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _ignored_emoji_count(result: Mapping[str, object]) -> int:
|
||||
if "input_cleanup" not in result:
|
||||
return 0
|
||||
cleanup = result["input_cleanup"]
|
||||
if (
|
||||
not isinstance(cleanup, dict)
|
||||
or set(cleanup) != {"ignored_emoji_count"}
|
||||
or type(cleanup.get("ignored_emoji_count")) is not int
|
||||
or cleanup["ignored_emoji_count"] <= 0
|
||||
):
|
||||
raise IngestionError("PROCESSOR_RESULT_INVALID", "processor input cleanup is invalid")
|
||||
return cleanup["ignored_emoji_count"]
|
||||
|
||||
@staticmethod
|
||||
def _output_path(output_dir: Path, value: object, suffix: str) -> Path:
|
||||
if (
|
||||
|
||||
Reference in new issue
Block a user