apache / apache/beam

[Feature Request]: User-facing API for defining schema/field options on user types

Open
#22,125 0 comments 0 reactions 0 assignees View on GitHub
core new feature P2 python schemas
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

### What would you like to happen?

We should have a user-facing API for defining beam schema options on user types. One concept might be a `@beam_option` decorator that can be applied to a class (schema-level metadata) or an attribute (field-level metadata).

```py
@beam_option("my_flag")
@beam_option("my_metadata", 123)
class MyRowType(NamedTuple):
@beam_option("my_field_flag")
foo: int
@beam_option("my_metadata", 456)
bar: str
```

### Issue Priority

Priority: 2

### Issue Component

Component: sdk-py-core

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.