Skip to content

Commit

Permalink
docs: remove hardcoded substitution variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sujuka99 committed Nov 3, 2023
1 parent d800e54 commit 605c2fe
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/docs/schema/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
"properties": {
"default_error_topic_name": {
"default": "${pipeline_name}-${component_name}-error",
"description": "Configures the value for the variable ${error_topic_name}",
"description": "Configures the value for the variable ${topic_name_config_default_error_topic_name}",
"env_names": [
"default_error_topic_name"
],
Expand Down
8 changes: 0 additions & 8 deletions docs/docs/user/core-concepts/variables/substitution.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ All of them are prefixed with `component_` and follow the following form: `compo

These variables include all fields in the [config](../config.md) and refer to the pipeline configuration that is independent of the components.

<!-- dprint-ignore-start -->

!!! info Aliases
`error_topic_name` is an alias for `topic_name_config_default_error_topic_name`
`output_topic_name` is an alias for `topic_name_config_default_output_topic_name`

<!-- dprint-ignore-end -->

## Environment variables

Environment variables such as `$PATH` can be used in the pipeline definition and defaults without any transformation following the form `${ENV_VAR_NAME}`. This, of course, includes variables like the ones relevant to the [KPOps cli](../../references/cli-commands.md) that are exported by the user.
Expand Down
6 changes: 3 additions & 3 deletions tests/components/test_kafka_sink_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def connector(
namespace="test-namespace",
to=ToSection(
topics={
TopicName("${topic_name_config_default_output_topic_name}"): TopicConfig(
type=OutputTopicTypes.OUTPUT, partitions_count=10
),
TopicName(
"${topic_name_config_default_output_topic_name}"
): TopicConfig(type=OutputTopicTypes.OUTPUT, partitions_count=10),
}
),
)
Expand Down
6 changes: 3 additions & 3 deletions tests/components/test_kafka_source_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def connector(
namespace="test-namespace",
to=ToSection(
topics={
TopicName("${topic_name_config_default_output_topic_name}"): TopicConfig(
type=OutputTopicTypes.OUTPUT, partitions_count=10
),
TopicName(
"${topic_name_config_default_output_topic_name}"
): TopicConfig(type=OutputTopicTypes.OUTPUT, partitions_count=10),
}
),
offset_topic="kafka-connect-offsets",
Expand Down
5 changes: 4 additions & 1 deletion tests/components/test_producer_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ def test_output_topics(self, config: KpopsConfig, handlers: ComponentHandlers):
},
)

assert producer_app.app.streams.output_topic == "${topic_name_config_default_output_topic_name}"
assert (
producer_app.app.streams.output_topic
== "${topic_name_config_default_output_topic_name}"
)
assert producer_app.app.streams.extra_output_topics == {
"first-extra-topic": "extra-topic-1"
}
Expand Down
10 changes: 8 additions & 2 deletions tests/components/test_streams_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,14 @@ def test_set_streams_output_from_to(
"first-extra-topic": "extra-topic-1",
"second-extra-topic": "extra-topic-2",
}
assert streams_app.app.streams.output_topic == "${topic_name_config_default_output_topic_name}"
assert streams_app.app.streams.error_topic == "${topic_name_config_default_error_topic_name}"
assert (
streams_app.app.streams.output_topic
== "${topic_name_config_default_output_topic_name}"
)
assert (
streams_app.app.streams.error_topic
== "${topic_name_config_default_error_topic_name}"
)

def test_weave_inputs_from_prev_component(
self, config: KpopsConfig, handlers: ComponentHandlers
Expand Down

0 comments on commit 605c2fe

Please sign in to comment.