Skip to content

Commit

Permalink
Fixes to the documentation templates, better layout with H1 and meta …
Browse files Browse the repository at this point in the history
…description.
  • Loading branch information
piotrczarnas committed Jan 10, 2024
1 parent 12833ff commit 5f8f5b1
Show file tree
Hide file tree
Showing 44 changed files with 293 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Objects;

/**
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average of a time window.
* Data quality rule that verifies if a data quality sensor readout value is not above X percent of the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* Data quality rule that verifies if a data quality sensor readout value
* doesn't excessively deviate from the moving average of a time window.
* doesn't excessively deviate from the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* Data quality rule that verifies if a data quality sensor readout value
* doesn't excessively deviate from the moving average of a time window.
* doesn't excessively deviate from the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* Data quality rule that verifies if a data quality sensor readout value
* doesn't excessively deviate from the moving average of a time window.
* doesn't excessively deviate from the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* Data quality rule that verifies if a data quality sensor readout value
* doesn't excessively deviate from the moving average of a time window.
* doesn't excessively deviate from the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* Data quality rule that verifies if a data quality sensor readout value
* doesn't excessively deviate from the moving average of a time window.
* doesn't excessively deviate from the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* Data quality rule that verifies if a data quality sensor readout value
* doesn't excessively deviate from the moving average of a time window.
* doesn't excessively deviate from the moving average within a time window.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
**{{replace primaryCheckName "_" " "}}** checks
# {{replace primaryCheckName "_" " "}} data quality checks
{{#if checkSpecClassJavaDoc}}
**Description**
{{checkSpecClassJavaDoc}}
{{else}}
{{/if}}

___
The **{{replace primaryCheckName "_" " "}}** data quality check has the following variants for each
[type of data quality](/docs/dqo-concepts/checks/index.md#types-of-checks) checks supported by DQOps.

{{#each allChecks}}
## **{{replace checkName "_" " "}}**
## {{replace checkName "_" " "}}


**Check description**

{{checkHelp}}

|Check name|Check type|Time scale|Quality dimension|Sensor definition|Quality rule|
|----------|----------|----------|-----------------|-----------------|------------|
|{{checkName}}|{{checkType}}|{{#if timeScale}}{{timeScale}}{{else}} {{/if}}|{{qualityDimension}}|[{{sensor.sensorName}}](../../../reference/sensors/{{target}}/{{sensor.category}}-{{target}}-sensors.md#{{replace sensor.sensorName "_" "-"}})|[{{rule.ruleName}}](../../../reference/rules/{{capitalizeFirst rule.category}}.md#{{replace rule.ruleName "_" "-"}})|

**Command-line examples**

Please expand the section below to see the DQOps command-line examples to run or activate the {{replace checkName "_" " "}} data quality check.

??? example "Managing {{replace checkName "_" " "}} check from DQOps shell"

=== "Activate check"
Expand All @@ -42,7 +50,8 @@ ___
dqo> check run -c=connection_name -t=schema_name.table_name -ch={{checkName}}
```

**Sample configuration (YAML)**
**YAML configuration**

The sample *schema_name.table_name.dqotable.yaml* file with the check configured is shown below.


Expand Down Expand Up @@ -115,24 +124,31 @@ Expand the *Configure with data grouping* section to see additional examples for
{{/if}}
{{#if runOnConnectionCliCommand}}
**CLI command to run check on connection**

```
{{runOnConnectionCliCommand}}
```

{{else}}
{{/if}}
{{#if runOnTableCliCommand}}
**CLI command to run check on table**

```
{{runOnTableCliCommand}}
```

{{else}}
{{/if}}
{{#if runOnColumnCliCommand}}
**CLI command to run check on column**

```
{{runOnColumnCliCommand}}
```

{{else}}
{{/if}}
___
{{/each}}

{{/each}}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {{header}}

**{{helpText}}**
{{helpText}}

{{#each checkTargets}}
{{#if (gt checkTargets.length 1)}}## {{capitalizeFirst this}} checks{{/if}}
Expand All @@ -13,8 +13,10 @@
|------------|------------|-------------|-------|
{{#each allChecks}}|[{{checkName}}](/docs/checks/{{target}}/{{categoryName}}/{{replace primaryCheckName " " "-"}}.md#{{replace checkName "_" "-"}})|{{checkType}}|{{checkHelp}}|{{checkClass}}|
{{/each}}

{{/each}}
{{else}}
{{/if}}
{{/each}}

{{/each}}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public List<CliRootCommandDocumentationModel> createCommandModels() {
for (Map.Entry<String, CommandLine> subcommand : firstLevelCommands.entrySet()) {
CliRootCommandDocumentationModel rootCommandModel = new CliRootCommandDocumentationModel();
rootCommandModel.setRootCommandName(subcommand.getKey());
rootCommandModel.setRootCommandHeader(extractRootCommandHeader(subcommand.getValue()));
rootCommandModel.setRootCommandDescription(extractRootCommandDescription(subcommand.getValue()));
rootCommands.add(rootCommandModel);

collectSubCommands(rootCommandModel, subcommand.getValue());
Expand All @@ -98,6 +100,40 @@ public List<CliRootCommandDocumentationModel> createCommandModels() {
return rootCommands;
}

/**
* Retrieves the header from the root command.
* @param commandLine Command line.
* @return Command header.
*/
public String extractRootCommandHeader(CommandLine commandLine) {
CommandLine.Model.CommandSpec commandSpec = commandLine.getCommandSpec();

CommandLine.Model.UsageMessageSpec usageMessageSpec = commandSpec.usageMessage();
String[] header = usageMessageSpec.header();
if (header == null) {
return null;
}

return String.join(" ", header);
}

/**
* Retrieves the description from the root command.
* @param commandLine Command line.
* @return Command description.
*/
public String extractRootCommandDescription(CommandLine commandLine) {
CommandLine.Model.CommandSpec commandSpec = commandLine.getCommandSpec();

CommandLine.Model.UsageMessageSpec usageMessageSpec = commandSpec.usageMessage();
String[] description = usageMessageSpec.description();
if (description == null) {
return null;
}

return String.join(" ", description);
}

/**
* Create 'dqo' root command used for the documentation.
* @return Root commands and their subcommands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ public class CliRootCommandDocumentationModel {
*/
private String rootCommandName;

/**
* The header of the root command.
*/
private String rootCommandHeader;

/**
* The description of the root command.
*/
private String rootCommandDescription;

/**
* List of commands.
*/
Expand Down
Loading

0 comments on commit 5f8f5b1

Please sign in to comment.