bigeye-cli 0.7.0__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/PKG-INFO +28 -6
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/CLI_DOCS.md +27 -5
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/catalog/catalog_commands.py +23 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/configure/configure_commands.py +15 -17
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/metric/metric_commands.py +25 -31
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/pyproject.toml +1 -1
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/LICENSE +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/__main__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/__version__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/bigconfig/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/bigconfig/bigconfig_commands.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/bigconfig/bigconfig_options.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/catalog/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/collections/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/collections/collection_commands.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/configure/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/deltas/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/deltas/deltas_commands.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/enums.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/exceptions/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/exceptions/exceptions.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/functions.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/global_options.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/issues/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/issues/issue_commands.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/lineage/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/lineage/lineage_commands.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/metric/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/model/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/model/cicd_conf.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/model/github_report.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/model/vendor_report.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/workspace/__init__.py +0 -0
- {bigeye_cli-0.7.0 → bigeye_cli-0.7.2}/bigeye_cli/workspace/workspace_commands.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: bigeye-cli
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: Bigeye CLI offers developer tools for maintaining your developer workspace.
|
|
5
5
|
Home-page: https://docs.bigeye.com/docs
|
|
6
6
|
License: Proprietary
|
|
@@ -18,7 +18,7 @@ Requires-Dist: rich (>=14.1.0,<15.0.0)
|
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
|
|
20
20
|
# **Bigeye CLI**
|
|
21
|
-
Version: 0.7.
|
|
21
|
+
Version: 0.7.2
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
24
24
|
**Setting up your local/build environment**
|
|
@@ -345,7 +345,9 @@ SECONDS_TIME_INTERVAL_TYPE:3
|
|
|
345
345
|
DAYS_TIME_INTERVAL_TYPE:4
|
|
346
346
|
WEEKDAYS_TIME_INTERVAL_TYPE:5
|
|
347
347
|
MARKET_DAYS_TIME_INTERVAL_TYPE:6
|
|
348
|
-
MONTHS_TIME_INTERVAL_TYPE:7
|
|
348
|
+
MONTHS_TIME_INTERVAL_TYPE:7
|
|
349
|
+
WEEKS_TIME_INTERVAL_TYPE:8
|
|
350
|
+
YEARS_TIME_INTERVAL_TYPE:9 [default: 1]
|
|
349
351
|
* `-value, --interval_value INTEGER`: Number of intervals to set on all metric schedules. If 0 use unschedule all metrics. [required]
|
|
350
352
|
* `--help`: Show this message and exit.
|
|
351
353
|
|
|
@@ -732,6 +734,7 @@ $ bigeye catalog [OPTIONS] COMMAND [ARGS]...
|
|
|
732
734
|
* `ingest-owners-from-dbt`: Ingest table owners from dbt manifest.json...
|
|
733
735
|
* `ingest-dbt-core-run-info`: Ingest manifest.json and run_results.json...
|
|
734
736
|
* `track-schema-changes`: Track schema changes for sources on demand...
|
|
737
|
+
* `sync-custom-repository`: Sync a custom repository from a YAML file.
|
|
735
738
|
|
|
736
739
|
## `bigeye catalog regen-autometrics`
|
|
737
740
|
|
|
@@ -965,7 +968,9 @@ SECONDS_TIME_INTERVAL_TYPE:3
|
|
|
965
968
|
DAYS_TIME_INTERVAL_TYPE:4
|
|
966
969
|
WEEKDAYS_TIME_INTERVAL_TYPE:5
|
|
967
970
|
MARKET_DAYS_TIME_INTERVAL_TYPE:6
|
|
968
|
-
MONTHS_TIME_INTERVAL_TYPE:7
|
|
971
|
+
MONTHS_TIME_INTERVAL_TYPE:7
|
|
972
|
+
WEEKS_TIME_INTERVAL_TYPE:8
|
|
973
|
+
YEARS_TIME_INTERVAL_TYPE:9 [default: 1]
|
|
969
974
|
* `-value, --interval_value INTEGER`: Number of intervals to set on all metric schedules. If 0 use unschedule all metrics. [required]
|
|
970
975
|
* `--help`: Show this message and exit.
|
|
971
976
|
|
|
@@ -1264,6 +1269,24 @@ $ bigeye catalog track-schema-changes [OPTIONS]
|
|
|
1264
1269
|
* `-t, --token TEXT`: The token to utilize the Slack web client. (Will attempt to use environment variable SLACK_BOT_TOKEN, if not set)
|
|
1265
1270
|
* `--help`: Show this message and exit.
|
|
1266
1271
|
|
|
1272
|
+
## `bigeye catalog sync-custom-repository`
|
|
1273
|
+
|
|
1274
|
+
Sync a custom repository from a YAML file.
|
|
1275
|
+
|
|
1276
|
+
**Usage**:
|
|
1277
|
+
|
|
1278
|
+
```console
|
|
1279
|
+
$ bigeye catalog sync-custom-repository [OPTIONS]
|
|
1280
|
+
```
|
|
1281
|
+
|
|
1282
|
+
**Options**:
|
|
1283
|
+
|
|
1284
|
+
* `-b, --bigeye_conf TEXT`: Bigeye Credential File Path [env var: BIGEYE_API_CRED_FILE]
|
|
1285
|
+
* `-c, --config_file TEXT`: Bigeye CLI Configuration File Path [env var: BIGEYE_API_CONFIG_FILE]
|
|
1286
|
+
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1287
|
+
* `-ip, --input_path TEXT`: The path to the CUSTOM_REPOSITORY_CONFIGURATION file (Required)
|
|
1288
|
+
* `--help`: Show this message and exit.
|
|
1289
|
+
|
|
1267
1290
|
# `bigeye metric`
|
|
1268
1291
|
|
|
1269
1292
|
Metric Commands for Bigeye CLI
|
|
@@ -1367,7 +1390,6 @@ $ bigeye metric upsert [OPTIONS]
|
|
|
1367
1390
|
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1368
1391
|
* `-f, --file TEXT`: File containing SimpleUpsedrtMetricRequest or MetricConfiguration [required]
|
|
1369
1392
|
* `-t, --file_type [SIMPLE|FULL]`: Metric File Type. Simple conforms to SimpleUpsertMetricRequest and Full conforms to MetricConfiguration [required]
|
|
1370
|
-
* `-wid, --warehouse_id INTEGER`: (Optional) Warehouse ID. If specified it will reduce the text based search for the table.warehouse
|
|
1371
1393
|
* `-mid, --metric_id INTEGER`: (Optional) Metric Id. If specified it will reduce the text based search for existing metric.
|
|
1372
1394
|
* `--help`: Show this message and exit.
|
|
1373
1395
|
|
|
@@ -1410,7 +1432,7 @@ $ bigeye metric dbt-tests-to-metrics [OPTIONS]
|
|
|
1410
1432
|
* `-sf, --schema_file TEXT`: The path to the dbt schema file [required]
|
|
1411
1433
|
* `-auto, --use_auto`: Use autothresholds over default constant
|
|
1412
1434
|
* `-bigconfig, --to_bigconfig`: Convert the dbt tests to bigconfig.
|
|
1413
|
-
* `-op, --output_path TEXT`: Output path where bigconfig file will be saved. If no output path is defined then current working directory will be used. Requires --to_bigconfig to be true.
|
|
1435
|
+
* `-op, --output_path TEXT`: Output path where bigconfig file will be saved. If no output path is defined then current working directory will be used. Requires --to_bigconfig to be true.
|
|
1414
1436
|
* `--help`: Show this message and exit.
|
|
1415
1437
|
|
|
1416
1438
|
# `bigeye issues`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# **Bigeye CLI**
|
|
2
|
-
Version: 0.7.
|
|
2
|
+
Version: 0.7.2
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
5
5
|
**Setting up your local/build environment**
|
|
@@ -326,7 +326,9 @@ SECONDS_TIME_INTERVAL_TYPE:3
|
|
|
326
326
|
DAYS_TIME_INTERVAL_TYPE:4
|
|
327
327
|
WEEKDAYS_TIME_INTERVAL_TYPE:5
|
|
328
328
|
MARKET_DAYS_TIME_INTERVAL_TYPE:6
|
|
329
|
-
MONTHS_TIME_INTERVAL_TYPE:7
|
|
329
|
+
MONTHS_TIME_INTERVAL_TYPE:7
|
|
330
|
+
WEEKS_TIME_INTERVAL_TYPE:8
|
|
331
|
+
YEARS_TIME_INTERVAL_TYPE:9 [default: 1]
|
|
330
332
|
* `-value, --interval_value INTEGER`: Number of intervals to set on all metric schedules. If 0 use unschedule all metrics. [required]
|
|
331
333
|
* `--help`: Show this message and exit.
|
|
332
334
|
|
|
@@ -713,6 +715,7 @@ $ bigeye catalog [OPTIONS] COMMAND [ARGS]...
|
|
|
713
715
|
* `ingest-owners-from-dbt`: Ingest table owners from dbt manifest.json...
|
|
714
716
|
* `ingest-dbt-core-run-info`: Ingest manifest.json and run_results.json...
|
|
715
717
|
* `track-schema-changes`: Track schema changes for sources on demand...
|
|
718
|
+
* `sync-custom-repository`: Sync a custom repository from a YAML file.
|
|
716
719
|
|
|
717
720
|
## `bigeye catalog regen-autometrics`
|
|
718
721
|
|
|
@@ -946,7 +949,9 @@ SECONDS_TIME_INTERVAL_TYPE:3
|
|
|
946
949
|
DAYS_TIME_INTERVAL_TYPE:4
|
|
947
950
|
WEEKDAYS_TIME_INTERVAL_TYPE:5
|
|
948
951
|
MARKET_DAYS_TIME_INTERVAL_TYPE:6
|
|
949
|
-
MONTHS_TIME_INTERVAL_TYPE:7
|
|
952
|
+
MONTHS_TIME_INTERVAL_TYPE:7
|
|
953
|
+
WEEKS_TIME_INTERVAL_TYPE:8
|
|
954
|
+
YEARS_TIME_INTERVAL_TYPE:9 [default: 1]
|
|
950
955
|
* `-value, --interval_value INTEGER`: Number of intervals to set on all metric schedules. If 0 use unschedule all metrics. [required]
|
|
951
956
|
* `--help`: Show this message and exit.
|
|
952
957
|
|
|
@@ -1245,6 +1250,24 @@ $ bigeye catalog track-schema-changes [OPTIONS]
|
|
|
1245
1250
|
* `-t, --token TEXT`: The token to utilize the Slack web client. (Will attempt to use environment variable SLACK_BOT_TOKEN, if not set)
|
|
1246
1251
|
* `--help`: Show this message and exit.
|
|
1247
1252
|
|
|
1253
|
+
## `bigeye catalog sync-custom-repository`
|
|
1254
|
+
|
|
1255
|
+
Sync a custom repository from a YAML file.
|
|
1256
|
+
|
|
1257
|
+
**Usage**:
|
|
1258
|
+
|
|
1259
|
+
```console
|
|
1260
|
+
$ bigeye catalog sync-custom-repository [OPTIONS]
|
|
1261
|
+
```
|
|
1262
|
+
|
|
1263
|
+
**Options**:
|
|
1264
|
+
|
|
1265
|
+
* `-b, --bigeye_conf TEXT`: Bigeye Credential File Path [env var: BIGEYE_API_CRED_FILE]
|
|
1266
|
+
* `-c, --config_file TEXT`: Bigeye CLI Configuration File Path [env var: BIGEYE_API_CONFIG_FILE]
|
|
1267
|
+
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1268
|
+
* `-ip, --input_path TEXT`: The path to the CUSTOM_REPOSITORY_CONFIGURATION file (Required)
|
|
1269
|
+
* `--help`: Show this message and exit.
|
|
1270
|
+
|
|
1248
1271
|
# `bigeye metric`
|
|
1249
1272
|
|
|
1250
1273
|
Metric Commands for Bigeye CLI
|
|
@@ -1348,7 +1371,6 @@ $ bigeye metric upsert [OPTIONS]
|
|
|
1348
1371
|
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1349
1372
|
* `-f, --file TEXT`: File containing SimpleUpsedrtMetricRequest or MetricConfiguration [required]
|
|
1350
1373
|
* `-t, --file_type [SIMPLE|FULL]`: Metric File Type. Simple conforms to SimpleUpsertMetricRequest and Full conforms to MetricConfiguration [required]
|
|
1351
|
-
* `-wid, --warehouse_id INTEGER`: (Optional) Warehouse ID. If specified it will reduce the text based search for the table.warehouse
|
|
1352
1374
|
* `-mid, --metric_id INTEGER`: (Optional) Metric Id. If specified it will reduce the text based search for existing metric.
|
|
1353
1375
|
* `--help`: Show this message and exit.
|
|
1354
1376
|
|
|
@@ -1391,7 +1413,7 @@ $ bigeye metric dbt-tests-to-metrics [OPTIONS]
|
|
|
1391
1413
|
* `-sf, --schema_file TEXT`: The path to the dbt schema file [required]
|
|
1392
1414
|
* `-auto, --use_auto`: Use autothresholds over default constant
|
|
1393
1415
|
* `-bigconfig, --to_bigconfig`: Convert the dbt tests to bigconfig.
|
|
1394
|
-
* `-op, --output_path TEXT`: Output path where bigconfig file will be saved. If no output path is defined then current working directory will be used. Requires --to_bigconfig to be true.
|
|
1416
|
+
* `-op, --output_path TEXT`: Output path where bigconfig file will be saved. If no output path is defined then current working directory will be used. Requires --to_bigconfig to be true.
|
|
1395
1417
|
* `--help`: Show this message and exit.
|
|
1396
1418
|
|
|
1397
1419
|
# `bigeye issues`
|
|
@@ -17,6 +17,7 @@ from bigeye_cli.exceptions.exceptions import MissingArgumentException
|
|
|
17
17
|
from bigeye_sdk.client.enum import Method
|
|
18
18
|
|
|
19
19
|
from bigeye_cli import global_options
|
|
20
|
+
from bigeye_sdk.controller.custom_repository_controller import CustomRepositoryController
|
|
20
21
|
from bigeye_sdk.functions.dbt import parse_dbt_manifest
|
|
21
22
|
from bigeye_sdk.functions.file_functs import read_json_file
|
|
22
23
|
from bigeye_sdk.functions.notifications import (
|
|
@@ -25,6 +26,7 @@ from bigeye_sdk.functions.notifications import (
|
|
|
25
26
|
post_webhook_request,
|
|
26
27
|
)
|
|
27
28
|
from bigeye_sdk.functions.search_and_match_functions import fuzzy_match
|
|
29
|
+
from bigeye_sdk.model.custom_repository_facade import CustomRepositoryConfigurationFile
|
|
28
30
|
from bigeye_sdk.model.dbt_manifest import DbtManifest
|
|
29
31
|
from bigeye_sdk.model.protobuf_enum_facade import (
|
|
30
32
|
MetricStatus,
|
|
@@ -1345,3 +1347,24 @@ def track_schema_changes(
|
|
|
1345
1347
|
else:
|
|
1346
1348
|
log.info("No frequency specified. The process will exit.")
|
|
1347
1349
|
sys.exit(0)
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
@app.command()
|
|
1353
|
+
def sync_custom_repository(
|
|
1354
|
+
bigeye_conf: str = global_options.bigeye_conf,
|
|
1355
|
+
config_file: str = global_options.config_file,
|
|
1356
|
+
workspace: str = global_options.workspace,
|
|
1357
|
+
input_path: Optional[str] = typer.Option(
|
|
1358
|
+
None
|
|
1359
|
+
, "--input_path"
|
|
1360
|
+
, "-ip"
|
|
1361
|
+
, help="The path to the CUSTOM_REPOSITORY_CONFIGURATION file (Required)"
|
|
1362
|
+
)
|
|
1363
|
+
):
|
|
1364
|
+
"""Sync a custom repository from a YAML file."""
|
|
1365
|
+
client = cli_client_factory(bigeye_conf, config_file, workspace)
|
|
1366
|
+
controller = CustomRepositoryController(client)
|
|
1367
|
+
|
|
1368
|
+
# Load and sync from YAML
|
|
1369
|
+
config = CustomRepositoryConfigurationFile.load(input_path)
|
|
1370
|
+
controller.sync_from_config(config, wait_for_completion=True)
|
|
@@ -60,43 +60,41 @@ def configure(
|
|
|
60
60
|
username = Prompt.ask("Enter Bigeye username")
|
|
61
61
|
uses_sso = Confirm.ask("Do you use SSO to access the Bigeye UI?")
|
|
62
62
|
if not uses_sso:
|
|
63
|
-
print(Text(text='\n** Please login to continue **', style='bold green'))
|
|
64
|
-
password = Prompt.ask("Enter Bigeye password for username above")
|
|
65
63
|
create_key = Confirm.ask("Would you like to create an API Key?")
|
|
66
|
-
|
|
67
|
-
user=username,
|
|
68
|
-
password=password)
|
|
64
|
+
|
|
69
65
|
if create_key:
|
|
66
|
+
print(Text(text='\n** Please login to create key **', style='bold green'))
|
|
67
|
+
password = Prompt.ask("Enter Bigeye password for username above")
|
|
68
|
+
basic_cred = BasicAPIAuth(base_url=base_url,
|
|
69
|
+
user=username,
|
|
70
|
+
password=password)
|
|
70
71
|
key_name = Prompt.ask("Enter a name for the key")
|
|
71
|
-
key_description = Prompt.ask("Enter a description (optional)", default="")
|
|
72
|
+
key_description = Prompt.ask("Enter a description (optional)", default="For CLI")
|
|
72
73
|
api_key = create_api_key_for_configuration(
|
|
73
74
|
cred=basic_cred, name=key_name, description=key_description
|
|
74
75
|
)
|
|
75
76
|
else:
|
|
76
77
|
api_key = Prompt.ask("Enter the API Key")
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
cred = APIKeyAuth(base_url=base_url, api_key=api_key)
|
|
80
|
+
required_config = get_workspace_id_for_user(cred=cred,
|
|
81
|
+
workspace=workspace,
|
|
82
|
+
use_default_credential=use_default_credential,
|
|
83
|
+
bigeye_username=username)
|
|
81
84
|
else:
|
|
82
85
|
print(Text(text='\n** Make sure you have created an API key in the UI **', style='bold green'))
|
|
83
86
|
api_key = Prompt.ask("Enter the API Key")
|
|
84
|
-
|
|
85
|
-
required_config = get_workspace_id_for_user(cred=
|
|
87
|
+
cred = APIKeyAuth(base_url=base_url, api_key=api_key)
|
|
88
|
+
required_config = get_workspace_id_for_user(cred=cred,
|
|
86
89
|
workspace=workspace,
|
|
87
90
|
use_default_credential=use_default_credential,
|
|
88
91
|
bigeye_username=username)
|
|
89
92
|
|
|
90
|
-
|
|
91
|
-
cred = APIKeyAuth(base_url=base_url, api_key=api_key)
|
|
92
|
-
|
|
93
93
|
else:
|
|
94
94
|
base_url = Prompt.ask("Enter the Bigeye URL", default="https://app.bigeye.com")
|
|
95
95
|
username = Prompt.ask("Enter the username")
|
|
96
96
|
password = Prompt.ask("Enter the password")
|
|
97
|
-
cred = BasicAPIAuth(base_url=base_url,
|
|
98
|
-
user=username,
|
|
99
|
-
password=password)
|
|
97
|
+
cred = BasicAPIAuth(base_url=base_url, user=username, password=password)
|
|
100
98
|
|
|
101
99
|
cred.save_as_file(auth_filename=bigeye_conf, cred=cred, workspace=workspace)
|
|
102
100
|
# If inheriting from default credential then load default credential
|
|
@@ -16,6 +16,7 @@ from bigeye_cli.enums import MetricFileType
|
|
|
16
16
|
from bigeye_sdk.controller.metric_controller import MetricController
|
|
17
17
|
from bigeye_sdk.functions.metric_functions import get_file_name_for_metric
|
|
18
18
|
from bigeye_sdk.functions.bigconfig_functions import build_fq_name
|
|
19
|
+
from bigeye_sdk.generated.com.bigeye.models._generated_root import NamedSchedule
|
|
19
20
|
from bigeye_sdk.model.dbt_schema import (
|
|
20
21
|
SimpleDbtSchema,
|
|
21
22
|
relationships_test_names,
|
|
@@ -183,37 +184,35 @@ def upsert_from_path(
|
|
|
183
184
|
"Row creation time is managed in the metricConfiguration with the 'rctOverride' field.",
|
|
184
185
|
DeprecationWarning
|
|
185
186
|
)
|
|
187
|
+
named_schedules = {s.name.strip().lower(): s.id for s in client.get_named_schedule().named_schedules}
|
|
186
188
|
|
|
187
189
|
for m in mil.metrics:
|
|
188
190
|
mc = m.metric_configuration
|
|
191
|
+
try:
|
|
192
|
+
mc.id = 0
|
|
193
|
+
mc.warehouse_id = target_warehouse_id
|
|
194
|
+
mc.dataset_id = t_ix[m.metric_metadata.dataset_name].id
|
|
195
|
+
|
|
196
|
+
if mc.metric_schedule.named_schedule.id != 0:
|
|
197
|
+
if mc.metric_schedule.named_schedule.name.strip().lower() in named_schedules:
|
|
198
|
+
mc.metric_schedule.named_schedule = NamedSchedule(id=named_schedules.get(
|
|
199
|
+
mc.metric_schedule.named_schedule.name.strip().lower())
|
|
200
|
+
)
|
|
201
|
+
else:
|
|
202
|
+
log.info(f"Named schedule {mc.metric_schedule.named_schedule.name} "
|
|
203
|
+
f"not found in workspace {client.config.workspace_id}. Creating...")
|
|
204
|
+
mc.metric_schedule.named_schedule.id = client.create_named_schedule(
|
|
205
|
+
name=mc.metric_schedule.named_schedule.name, cron=mc.metric_schedule.named_schedule.cron).id
|
|
189
206
|
|
|
190
|
-
log.info(mc)
|
|
191
207
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
filters=mc.filters,
|
|
196
|
-
group_bys=mc.group_bys,
|
|
197
|
-
thresholds=mc.thresholds,
|
|
198
|
-
notification_channels=mc.notification_channels,
|
|
199
|
-
warehouse_id=target_warehouse_id,
|
|
200
|
-
dataset_id=t_ix[m.metric_metadata.dataset_name].id,
|
|
201
|
-
metric_type=mc.metric_type,
|
|
202
|
-
parameters=mc.parameters,
|
|
203
|
-
lookback=mc.lookback,
|
|
204
|
-
lookback_type=mc.lookback_type,
|
|
205
|
-
metric_creation_state=mc.metric_creation_state,
|
|
206
|
-
grain_seconds=mc.grain_seconds,
|
|
207
|
-
muted_until_epoch_seconds=mc.muted_until_epoch_seconds,
|
|
208
|
-
name=mc.name,
|
|
209
|
-
description=mc.description,
|
|
210
|
-
rct_override=mc.rct_override
|
|
211
|
-
)
|
|
208
|
+
log.info(f"Updated metric configuration: {mc}")
|
|
209
|
+
|
|
210
|
+
rmc = client.upsert_metric(metric_configuration=mc)
|
|
212
211
|
|
|
213
212
|
if update_collections:
|
|
214
213
|
for c in m.collections:
|
|
215
214
|
client.upsert_metric_to_collection(
|
|
216
|
-
|
|
215
|
+
collection_name=c.display_name, add_metric_ids=[rmc.id]
|
|
217
216
|
)
|
|
218
217
|
|
|
219
218
|
except Exception as e:
|
|
@@ -239,13 +238,6 @@ def upsert(
|
|
|
239
238
|
help="Metric File Type. Simple conforms to SimpleUpsertMetricRequest and Full conforms to "
|
|
240
239
|
"MetricConfiguration",
|
|
241
240
|
),
|
|
242
|
-
target_warehouse_id: int = typer.Option(
|
|
243
|
-
None,
|
|
244
|
-
"--warehouse_id",
|
|
245
|
-
"-wid",
|
|
246
|
-
help="(Optional) Warehouse ID. If specified it will reduce the text based search for the table."
|
|
247
|
-
"warehouse",
|
|
248
|
-
),
|
|
249
241
|
existing_metric_id: int = typer.Option(
|
|
250
242
|
None,
|
|
251
243
|
"--metric_id",
|
|
@@ -322,11 +314,11 @@ def dbt_tests_to_metrics(
|
|
|
322
314
|
help="Convert the dbt tests to bigconfig.",
|
|
323
315
|
),
|
|
324
316
|
output_path: str = typer.Option(
|
|
325
|
-
|
|
317
|
+
None,
|
|
326
318
|
"--output_path",
|
|
327
319
|
"-op",
|
|
328
320
|
help="Output path where bigconfig file will be saved. If no output path is defined "
|
|
329
|
-
"then current working directory will be used. Requires --to_bigconfig to be true."
|
|
321
|
+
"then current working directory will be used. Requires --to_bigconfig to be true."
|
|
330
322
|
),
|
|
331
323
|
):
|
|
332
324
|
"""Convert tests in a dbt schema.yml to metrics in Bigeye"""
|
|
@@ -454,6 +446,8 @@ def dbt_tests_to_metrics(
|
|
|
454
446
|
tag_deployments=tag_deployments, collection=collection
|
|
455
447
|
)
|
|
456
448
|
file_name = collection.name.lower().replace(" ", "_")
|
|
449
|
+
if not output_path:
|
|
450
|
+
output_path = Path.cwd()
|
|
457
451
|
output = bigconfig.save(
|
|
458
452
|
output_path=output_path,
|
|
459
453
|
default_file_name=f"{file_name}.bigconfig",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|