sakshammalik260-cse commented on issue #41223:
URL: https://github.com/apache/beam/issues/41223#issuecomment-7315883021
Hi maintainers,
I've been working on a provisional implementation of the native Python/YAML
`Expect` transform for this issue.
The current implementation supports:
- Schema-aware SQL-style Boolean expectations.
- Per-rule `dlq`, `drop`, and `fail` actions.
- Configurable tagged dead-letter outputs.
- Preservation of the valid input schema.
- Structured violation metadata.
- Per-rule pass and quarantine counters using Beam's standard Metrics API.
- Native Beam YAML integration.
Before opening a PR, I'd appreciate feedback on a few design decisions:
1. Expression evaluation: Would a restricted, dependency-free Python
SQL-style predicate evaluator be acceptable, or would you prefer integration
with existing Beam SQL or YAML expression infrastructure?
2. Multiple violations:The prototype evaluates all rules and applies `fail >
dlq > drop` precedence. Does this match the intended behavior?
3. DLQ schema: The prototype emits one record containing the original
element, structured violation details, a summary message, and an empty stack
field for compatibility with existing YAML error conventions.
4. Metrics: The prototype uses the standard Beam Metrics API with the
namespace `apache_beam.transforms.expect` and counter names
`expectation_passed:{rule}` and `expectation_quarantined:{rule}`. Additional
diagnostic and record-routing counters are currently included.
5. YAML output handling: The valid output is named `good`, with a
configurable DLQ tag. The names `good` and `output` are reserved to avoid
conflicts with YAML main-output resolution.
6. Resource limits: Individual expressions have bounded parsing and
evaluation costs. Would maintainers prefer fixed aggregate rule-count and
configuration limits, configurable limits, or documented pipeline-author
responsibility?
The prototype has passed targeted regression tests and local execution
checks, including embedded, threaded, and subprocess worker modes.
I'd be happy to adjust or simplify the implementation based on your feedback
before submitting it for formal review.
Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]