Skip to content

Commit

Permalink
Merge pull request #14 from Qualytics/sc-15851/checks-export-with-tags
Browse files Browse the repository at this point in the history
Sc 15851/checks export with tags
  • Loading branch information
shindiogawa authored Feb 27, 2024
2 parents df228e6 + 59ea1cc commit c1f53a7
Show file tree
Hide file tree
Showing 6 changed files with 367 additions and 180 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.10
current_version = 0.1.11
commit = True
tag = True
tag_name = {new_version}
Expand Down
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Install me with:
# pip install pre-commit
# pre-commit install
#
# Run manually as:
# pre-commit run --all-files
repos:
# general checks (see here: https://pre-commit.com/hooks.html)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-json
exclude: ^(.vscode|.devcontainer)
- id: check-case-conflict
- id: detect-private-key
exclude: tests/test_datastores.py
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: check-toml

# Run the Ruff linter.
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.2
hooks:
# Run the Ruff formatter.
- id: ruff-format
# Run the Ruff linter.
- id: ruff
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,18 @@ qualytics show-config
You can export checks to a file using the `checks export` command:

```bash
qualytics checks export --datastore DATASTORE_ID
qualytics checks export --datastore DATASTORE_ID [--containers CONTAINER_IDS] [--tags TAG_NAMES] [--output LOCATION_TO_BE_EXPORTED]
```

By default, it saves the exported checks to `./qualytics/data_checks.json`. However, you can specify a different output path with the `--output` option.


| Option | Type | Description | Default | Required |
|---------------|----------|------------------------------|------------------------------------|----------|
| `--datastore` | INTEGER | Datastore ID | None | Yes |
| `--output` | TEXT | Output file path | ./qualytics/data_checks.json | No |
| Option | Type | Description | Default | Required |
|----------------|-----------------|------------------|------------------------------------|---------|
| `--datastore` | INTEGER | Datastore ID | None | Yes |
| `--containers` | List of INTEGER | Containers IDs | None | No |
| `--tags` | List of TEXT | Tag names | None | No |
| `--output` | TEXT | Output file path | ./qualytics/data_checks.json | No |


### Export Check Templates
Expand All @@ -94,17 +96,17 @@ To import checks from a file:


```bash
qualytics checks import --datastore DATASTORE_ID_LIST
qualytics checks import --datastore DATASTORE_ID_LIST [--input LOCATION_FROM_THE_EXPORT]
```

By default, it reads the checks from `./qualytics/data_checks.json`. You can specify a different input file with the `--input` option.

**Note**: Any errors encountered during the importing of checks will be logged in `./qualytics/errors.log`.

| Option | Type | Description | Default | Required |
|--------------|------|----------------------------------------------------------------------|-----------------------------------|----------|
| `--datastore`| TEXT | Comma-separated list of Datastore IDs or array-like format. Example: 1,2,3,4,5 or "[1,2,3,4,5]" | None | Yes |
| `--input` | TEXT | Input file path
| Option | Type | Description | Default | Required |
|--------------|------|----------------------------------------------------------------------|-------------------------------|----------|
| `--datastore`| TEXT | Comma-separated list of Datastore IDs or array-like format. Example: 1,2,3,4,5 or "[1,2,3,4,5]" | None | Yes |
| `--input` | TEXT | Input file path | HOME/.qualytics/data_checks.json | None |


### Schedule Metadata Export:
Expand Down
Loading

0 comments on commit c1f53a7

Please sign in to comment.