Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor input/output types #232

Merged
merged 51 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
3188799
refactor: set defaults to topic types
sujuka99 Jun 2, 2023
be863ef
feat: Allow empty topic definitions, infer topics type
sujuka99 Jun 9, 2023
3a14350
Merge remote-tracking branch 'origin/main' into refactor/input-output…
sujuka99 Jun 12, 2023
56dc07b
chore: polish and clean up
sujuka99 Jun 12, 2023
13802de
chore: update poetry version in CI
sujuka99 Jun 12, 2023
b9cd890
Merge remote-tracking branch 'origin/main' into refactor/input-output…
sujuka99 Jun 13, 2023
0bd4736
Merge remote-tracking branch 'origin/main' into refactor/input-output…
sujuka99 Jun 13, 2023
11cb62a
chore: update schema
sujuka99 Jun 13, 2023
a514af7
Merge remote-tracking branch 'origin/main' into refactor/input-output…
sujuka99 Jun 13, 2023
43cfcf2
chore: pass tests
sujuka99 Jun 13, 2023
5b681c9
docs: update
sujuka99 Jun 13, 2023
1e64a6f
feat: enable type inference for components
sujuka99 Jun 13, 2023
5b860b6
docs(examples): Update to reflect the introduced feature
sujuka99 Jun 14, 2023
c3d9632
Merge remote-tracking branch 'origin/main' into refactor/input-output…
sujuka99 Jun 14, 2023
16468cb
style: update docstr
sujuka99 Jun 14, 2023
53663a1
misc: feedback
sujuka99 Jun 14, 2023
ee17c5f
refactor: disallow empty topic def
sujuka99 Jun 14, 2023
5a79f56
Merge remote-tracking branch 'origin/main' into refactor/input-output…
sujuka99 Jun 14, 2023
2566df6
tests: update to reflect extra options
sujuka99 Jun 14, 2023
96642c1
refactor: dont reassign type
sujuka99 Jun 14, 2023
10c283d
refactor: replace if-else with pattern-matching
sujuka99 Jun 14, 2023
e98161c
docs: update
sujuka99 Jun 14, 2023
35aa35a
docs: fix role and schema comments
sujuka99 Jun 14, 2023
4e51e5a
docs: fix extra-pattern-topic in examples
sujuka99 Jun 14, 2023
b61fdf9
docs: fix input-component name
sujuka99 Jun 14, 2023
06a1558
docs: improve comments in code
sujuka99 Jun 14, 2023
c251fe1
chore: pass tests
sujuka99 Jun 14, 2023
0c3dafc
refactor: add type assignment to root validator
sujuka99 Jun 14, 2023
7220ffd
refactor(from): simplify
sujuka99 Jun 15, 2023
21b728e
feat: remove redundant types from `from`
sujuka99 Jun 15, 2023
2d8f7fb
refactor: remove redundant output topic types
sujuka99 Jun 15, 2023
138faae
Merge remote-tracking branch 'origin/main' into refactor/input-output…
sujuka99 Jun 15, 2023
a05beff
chore: pass tests
sujuka99 Jun 15, 2023
e4695a4
docs(examples): Update
sujuka99 Jun 15, 2023
dfe9d8f
style: remove type from docstr
sujuka99 Jun 15, 2023
d3f9bb1
refactor: move type implication into component
sujuka99 Jun 27, 2023
8bb1a19
fix: topic weaving
sujuka99 Jun 27, 2023
a9d5c18
chore: pass tests
sujuka99 Jun 27, 2023
0d175c0
Merge remote-tracking branch 'origin/main' into refactor/input-output…
sujuka99 Jun 27, 2023
19bc197
Merge remote-tracking branch 'origin/v2' into refactor/input-output-t…
sujuka99 Aug 15, 2023
8af5212
docs: update from and to sections
sujuka99 Aug 15, 2023
efec342
fix: revert wrong change
sujuka99 Aug 15, 2023
2e071c1
chore: generate docs
sujuka99 Aug 15, 2023
ca33389
chore: revert problems from the merge
sujuka99 Aug 15, 2023
137f219
fix: tests
sujuka99 Aug 15, 2023
5ab0ad1
chore: trailing comma
sujuka99 Aug 15, 2023
bf57e19
fix: typo
sujuka99 Aug 15, 2023
0db3ea5
Apply suggestions from code review
sujuka99 Aug 15, 2023
32bc451
fix: missing import
sujuka99 Aug 15, 2023
f180073
docs: Do not document usage of `null`
sujuka99 Aug 16, 2023
e7ca9ac
docs: fix typo
sujuka99 Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/docs/resources/pipeline-components/kafka-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
to:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
# Currently KPOps only supports Avro schemas.
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
replication_factor: 1
configs:
configs: # https://kafka.apache.org/documentation/#topicconfigs
cleanup.policy: compact
models: # SchemaProvider is initiated with the values given here
model: model
Expand Down
27 changes: 24 additions & 3 deletions docs/docs/resources/pipeline-components/kafka-connector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,34 @@
from:
topics: # required
${pipeline_name}-input-topic:
type: input # required
# role: topic-role # only used if type is `extra`
type: input # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra
${pipeline_name}-input-pattern-topic:
type: pattern # Implied to be an input pattern if `role` is undefined
${pipeline_name}-extra-pattern-topic:
type: pattern # Implied to be an extra pattern if `role` undefined
disrupted marked this conversation as resolved.
Show resolved Hide resolved
role: some-role
components: # read from specific component
account-producer:
type: output # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
other-producer:
role: some-role # Implies `type` to be extra
component-as-input-pattern:
type: pattern # Implied to be an input pattern if `role` is undefined
component-as-extra-pattern:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
# Topic(s) into which the component will write output
to:
topics: # required
${pipeline_name}-output-topic:
type: error # required
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
Expand Down
29 changes: 24 additions & 5 deletions docs/docs/resources/pipeline-components/kafka-sink-connector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,34 @@
from:
topics: # required
${pipeline_name}-input-topic:
type: input # required
# role: topic-role # only used if type is `extra`
type: input # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra
${pipeline_name}-input-pattern-topic:
type: pattern # Implied to be an input pattern if `role` is undefined
${pipeline_name}-extra-pattern-topic:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
components: # read from specific component
- producer
account-producer:
type: output # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
other-producer:
role: some-role # Implies `type` to be extra
component-as-input-pattern:
type: pattern # Implied to be an input pattern if `role` is undefined
component-as-extra-pattern:
type: pattern # Implied to be an extra pattern if `role` undefined
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved
role: some-role
# Topic(s) into which the component will write output
to:
topics:
topics: # required
${pipeline_name}-output-topic:
type: error # required
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
to:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
Expand Down
30 changes: 24 additions & 6 deletions docs/docs/resources/pipeline-components/kubernetes-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,34 @@
from:
topics: # required
${pipeline_name}-input-topic:
type: input # required
# role: topic-role # only used if type is `extra` or `extra-pattern`
type: input # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra
${pipeline_name}-input-pattern-topic:
type: pattern # Implied to be an input pattern if `role` is undefined
${pipeline_name}-extra-pattern-topic:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
components: # read from specific component
- producer
account-producer:
type: output # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
other-producer:
role: some-role # Implies `type` to be extra
component-as-input-pattern:
type: pattern # Implied to be an input pattern if `role` is undefined
component-as-extra-pattern:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
# Topic(s) into which the component will write output
to:
topics:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
Expand Down
114 changes: 93 additions & 21 deletions docs/docs/resources/pipeline-components/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,34 @@
from:
topics: # required
${pipeline_name}-input-topic:
type: input # required
# role: topic-role # only used if type is `extra` or `extra-pattern`
type: input # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra
${pipeline_name}-input-pattern-topic:
type: pattern # Implied to be an input pattern if `role` is undefined
${pipeline_name}-extra-pattern-topic:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
components: # read from specific component
account-producer:
type: output # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
other-producer:
role: some-role # Implies `type` to be extra
component-as-input-pattern:
type: pattern # Implied to be an input pattern if `role` is undefined
component-as-extra-pattern:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
# Topic(s) into which the component will write output
to:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
Expand Down Expand Up @@ -61,14 +81,17 @@
to:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
# Currently KPOps only supports Avro schemas.
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
replication_factor: 1
configs:
configs: # https://kafka.apache.org/documentation/#topicconfigs
cleanup.policy: compact
models: # SchemaProvider is initiated with the values given here
model: model
Expand Down Expand Up @@ -150,19 +173,39 @@
from:
topics: # required
${pipeline_name}-input-topic:
type: input # required
# role: topic-role # only used if type is `extra` or `extra-pattern`
type: input # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra
${pipeline_name}-input-pattern-topic:
type: pattern # Implied to be an input pattern if `role` is undefined
${pipeline_name}-extra-pattern-topic:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
components: # read from specific component
account-producer:
type: output # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
other-producer:
role: some-role # Implies `type` to be extra
component-as-input-pattern:
type: pattern # Implied to be an input pattern if `role` is undefined
component-as-extra-pattern:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
# Topic(s) into which the component will write output
to:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
replication_factor: 1
configs:
configs: # https://kafka.apache.org/documentation/#topicconfigs
cleanup.policy: compact
models: # SchemaProvider is initiated with the values given here
model: model
Expand Down Expand Up @@ -201,8 +244,12 @@
to:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
Expand Down Expand Up @@ -238,8 +285,12 @@
to:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
Expand Down Expand Up @@ -281,13 +332,34 @@
from:
topics: # required
${pipeline_name}-input-topic:
type: input # required
# role: topic-role # only used if type is `extra`
type: input # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra
${pipeline_name}-input-pattern-topic:
type: pattern # Implied to be an input pattern if `role` is undefined
${pipeline_name}-extra-pattern-topic:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
components: # read from specific component
account-producer:
type: output # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
other-producer:
role: some-role # Implies `type` to be extra
component-as-input-pattern:
type: pattern # Implied to be an input pattern if `role` is undefined
component-as-extra-pattern:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
# Topic(s) into which the component will write output
to:
to:
topics: # required
${pipeline_name}-output-topic:
type: error # required
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
Expand Down
8 changes: 6 additions & 2 deletions docs/docs/resources/pipeline-components/producer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
to:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
Expand Down
32 changes: 25 additions & 7 deletions docs/docs/resources/pipeline-components/streams-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,39 @@
from:
topics: # required
${pipeline_name}-input-topic:
type: input # required
# role: topic-role # only used if type is `extra` or `extra-pattern`
type: input # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra
${pipeline_name}-input-pattern-topic:
type: pattern # Implied to be an input pattern if `role` is undefined
${pipeline_name}-extra-pattern-topic:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
components: # read from specific component
- producer
account-producer:
type: output # Implied when role is NOT specified, alternatives of `type: null` or `role: null` also work
other-producer:
role: some-role # Implies `type` to be extra
component-as-input-pattern:
type: pattern # Implied to be an input pattern if `role` is undefined
component-as-extra-pattern:
type: pattern # Implied to be an extra pattern if `role` undefined
role: some-role
# Topic(s) into which the component will write output
to:
topics:
topics: # required
${pipeline_name}-output-topic:
type: output # required
# role: topic-role # only used if type is `extra`
type: output # Implied when role is NOT specified
${pipeline_name}-extra-topic:
role: topic-role # Implies `type` to be extra; Will throw an error if `type` is defined
${pipeline_name}-error-topic:
type: error
# Currently KPOps supports Avro and JSON schemas.
keySchema: key-schema # must implement SchemaProvider to use
valueSchema: value-schema
partitions_count: 1
replication_factor: 1
configs:
configs: # https://kafka.apache.org/documentation/#topicconfigs
cleanup.policy: compact
models: # SchemaProvider is initiated with the values given here
model: model
Expand Down
Loading