Skip to content

Commit 419433e

Browse files
committed
Fix typos and outdated info in Konfig Best Practices guide
Signed-off-by: Mikhail Zholobov <legal90@gmail.com>
1 parent 4f141c9 commit 419433e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

docs/user_docs/guides/working-with-konfig/4-best-practice.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ schema SLI:
8787
8888
The type of template is a combination of two string types, indicating that the template can only be `"success_ratio"` or `"service_cost"`. When the user fills in the values of other strings, the KCL compiler will report an error.
8989
90-
In addition to using union types for literal types, KCL also supports union for complex types such as schema types. For the support of this backend **oneof** configuration, KCL has built-in composite structure union types for support. For example, we can define our own SLI front-end types for various scenarios: `CustomSliDataSource`, `PQLSLIDataSource`, and `StackSLIDataSource`.
90+
In addition to using union types for literal types, KCL also supports union for complex types such as schema types. For the support of this backend **oneof** configuration, KCL has built-in composite structure union types for support. For example, we can define our own SLI front-end types for various scenarios: `CustomSLIDataSource`, `PQLSLIDataSource`, and `StackSLIDataSource`.
9191

9292
```python
9393
schema CustomSLIDataSource:
@@ -175,7 +175,7 @@ house = House {
175175
}
176176
```
177177

178-
For example, in the above example, if you want to query the age of the person named `"Alice"` from the list of persons in the house, you need to loop through the list to find Alice's age. However, if you define persons as a dictionary like the following code, it not only looks more concise in code, but you can also directly retrieve Alice's age by using house.persons.Alice.age. In addition, the information of the entire configuration is complete and has no redundant information.
178+
For example, in the above example, if you want to query the age of the person named `"Alice"` from the list of persons in the house, you need to loop through the list to find Alice's age. However, if you define persons as a dictionary like the following code, it not only looks more concise in code, but you can also directly retrieve Alice's age by using `house.persons.Alice.age`. In addition, the information of the entire configuration is complete and has no redundant information.
179179

180180
```python
181181
schema Person:
@@ -346,11 +346,10 @@ The output is
346346

347347
```yaml
348348
cpuMap:
349-
"1": 256
350-
"2": 512
351-
"3": 1024
352-
cpu256: 256
353-
cpu2048: 2048
349+
'1': 256
350+
'2': 512
351+
'3': 1024
352+
cpu: 256
354353
```
355354
356355
### Separate Logic and Data

0 commit comments

Comments
 (0)