bigeye-cli 0.7.1__tar.gz → 0.7.3__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.
Files changed (35) hide show
  1. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/PKG-INFO +5 -5
  2. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/CLI_DOCS.md +4 -4
  3. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/catalog/catalog_commands.py +3 -3
  4. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/metric/metric_commands.py +39 -27
  5. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/pyproject.toml +1 -1
  6. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/LICENSE +0 -0
  7. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/__init__.py +0 -0
  8. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/__main__.py +0 -0
  9. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/__version__.py +0 -0
  10. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/bigconfig/__init__.py +0 -0
  11. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/bigconfig/bigconfig_commands.py +0 -0
  12. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/bigconfig/bigconfig_options.py +0 -0
  13. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/catalog/__init__.py +0 -0
  14. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/collections/__init__.py +0 -0
  15. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/collections/collection_commands.py +0 -0
  16. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/configure/__init__.py +0 -0
  17. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/configure/configure_commands.py +0 -0
  18. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/deltas/__init__.py +0 -0
  19. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/deltas/deltas_commands.py +0 -0
  20. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/enums.py +0 -0
  21. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/exceptions/__init__.py +0 -0
  22. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/exceptions/exceptions.py +0 -0
  23. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/functions.py +0 -0
  24. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/global_options.py +0 -0
  25. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/issues/__init__.py +0 -0
  26. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/issues/issue_commands.py +0 -0
  27. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/lineage/__init__.py +0 -0
  28. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/lineage/lineage_commands.py +0 -0
  29. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/metric/__init__.py +0 -0
  30. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/model/__init__.py +0 -0
  31. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/model/cicd_conf.py +0 -0
  32. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/model/github_report.py +0 -0
  33. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/model/vendor_report.py +0 -0
  34. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/bigeye_cli/workspace/__init__.py +0 -0
  35. {bigeye_cli-0.7.1 → bigeye_cli-0.7.3}/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.1
3
+ Version: 0.7.3
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.1
21
+ Version: 0.7.3
22
22
  ## Installation
23
23
 
24
24
  **Setting up your local/build environment**
@@ -709,7 +709,7 @@ $ bigeye catalog [OPTIONS] COMMAND [ARGS]...
709
709
 
710
710
  **Commands**:
711
711
 
712
- * `regen-autometrics`: Regenerates Autometrics by warehouse id OR...
712
+ * `regen-autometrics`: Regenerates Autometrics by warehouse id OR... (DEPRECATED)
713
713
  * `delete-metrics`: Delete metrics in a warehouse id, by...
714
714
  * `rebuild`: Rebuilds/Reprofiles a source by warehouse...
715
715
  * `get-table-info`: Outputs table info to a file for an entire...
@@ -721,8 +721,8 @@ $ bigeye catalog [OPTIONS] COMMAND [ARGS]...
721
721
  * `backfill-metrics`: Backfills metrics by warehouse id, schema...
722
722
  * `schedule-all-metrics`: Updates schedule for all metrics in a...
723
723
  * `unschedule-all-metrics`: Unschedule all metrics by warehouse,...
724
- * `set-metric-time`: Sets metric times from a list of possible...
725
- * `unset-metric-time`: Unsets metric times for whole warehouse or...
724
+ * `set-metric-time`: Sets metric times from a list of possible... (DEPRECATED)
725
+ * `unset-metric-time`: Unsets metric times for whole warehouse or... (DEPRECATED)
726
726
  * `get-metric-queries`: Gets the debug queries for all metrics by...
727
727
  * `upsert-template`: Create or update a template for a source.
728
728
  * `export-metric-template`: Export metric templates to yaml files
@@ -1,5 +1,5 @@
1
1
  # **Bigeye CLI**
2
- Version: 0.7.1
2
+ Version: 0.7.3
3
3
  ## Installation
4
4
 
5
5
  **Setting up your local/build environment**
@@ -690,7 +690,7 @@ $ bigeye catalog [OPTIONS] COMMAND [ARGS]...
690
690
 
691
691
  **Commands**:
692
692
 
693
- * `regen-autometrics`: Regenerates Autometrics by warehouse id OR...
693
+ * `regen-autometrics`: Regenerates Autometrics by warehouse id OR... (DEPRECATED)
694
694
  * `delete-metrics`: Delete metrics in a warehouse id, by...
695
695
  * `rebuild`: Rebuilds/Reprofiles a source by warehouse...
696
696
  * `get-table-info`: Outputs table info to a file for an entire...
@@ -702,8 +702,8 @@ $ bigeye catalog [OPTIONS] COMMAND [ARGS]...
702
702
  * `backfill-metrics`: Backfills metrics by warehouse id, schema...
703
703
  * `schedule-all-metrics`: Updates schedule for all metrics in a...
704
704
  * `unschedule-all-metrics`: Unschedule all metrics by warehouse,...
705
- * `set-metric-time`: Sets metric times from a list of possible...
706
- * `unset-metric-time`: Unsets metric times for whole warehouse or...
705
+ * `set-metric-time`: Sets metric times from a list of possible... (DEPRECATED)
706
+ * `unset-metric-time`: Unsets metric times for whole warehouse or... (DEPRECATED)
707
707
  * `get-metric-queries`: Gets the debug queries for all metrics by...
708
708
  * `upsert-template`: Create or update a template for a source.
709
709
  * `export-metric-template`: Export metric templates to yaml files
@@ -72,7 +72,7 @@ would include metrics batched at any of these levels.
72
72
  """
73
73
 
74
74
 
75
- @app.command()
75
+ @app.command(deprecated=True)
76
76
  def regen_autometrics(
77
77
  bigeye_conf: str = global_options.bigeye_conf,
78
78
  config_file: str = global_options.config_file,
@@ -629,7 +629,7 @@ def unschedule_all_metrics(
629
629
  response = client._call_datawatch(Method.POST, url=url, body=json.dumps(body))
630
630
 
631
631
 
632
- @app.command()
632
+ @app.command(deprecated=True)
633
633
  def set_metric_time(
634
634
  bigeye_conf: str = global_options.bigeye_conf,
635
635
  config_file: str = global_options.config_file,
@@ -676,7 +676,7 @@ def set_metric_time(
676
676
  raise Exception("Must include either table IDs OR warehouse ID OR schema ID.")
677
677
 
678
678
 
679
- @app.command()
679
+ @app.command(deprecated=True)
680
680
  def unset_metric_time(
681
681
  bigeye_conf: str = global_options.bigeye_conf,
682
682
  config_file: str = global_options.config_file,
@@ -1,12 +1,13 @@
1
- # create logger
1
+
2
2
  import warnings
3
+ from collections import defaultdict
3
4
  from os import listdir
4
5
  from os.path import join, isfile
5
6
  from typing import List, Dict
6
7
 
7
8
  import smart_open
8
9
  import typer
9
- import json
10
+
10
11
  from pathlib import Path
11
12
 
12
13
  import yaml
@@ -36,9 +37,10 @@ from bigeye_cli.functions import (
36
37
  from bigeye_sdk.generated.com.bigeye.models.generated import (
37
38
  MetricInfoList,
38
39
  MetricInfo,
39
- TableList,
40
40
  Table,
41
41
  MetricConfiguration,
42
+ NamedSchedule,
43
+ TemplateMetric
42
44
  )
43
45
  from bigeye_sdk.model.big_config import BigConfig, TagDeployment, ColumnSelector
44
46
  from bigeye_sdk.model.metric_facade import SimpleUpsertMetricRequest
@@ -176,6 +178,7 @@ def upsert_from_path(
176
178
  ).tables
177
179
 
178
180
  t_ix: Dict[str, Table] = {t.name: t for t in tables}
181
+ c_ix: Dict[str, List[int]] = defaultdict(list)
179
182
 
180
183
  if set_row_creation_time:
181
184
  warnings.warn(
@@ -183,43 +186,52 @@ def upsert_from_path(
183
186
  "Row creation time is managed in the metricConfiguration with the 'rctOverride' field.",
184
187
  DeprecationWarning
185
188
  )
189
+ named_schedules = {s.name.strip().lower(): s.id for s in client.get_named_schedule().named_schedules}
186
190
 
187
191
  for m in mil.metrics:
188
192
  mc = m.metric_configuration
193
+ try:
194
+ mc.id = 0
195
+ mc.warehouse_id = target_warehouse_id
196
+ mc.dataset_id = t_ix[m.metric_metadata.dataset_name].id
197
+
198
+ if mc.metric_schedule.named_schedule.id != 0:
199
+ if mc.metric_schedule.named_schedule.name.strip().lower() in named_schedules:
200
+ mc.metric_schedule.named_schedule = NamedSchedule(id=named_schedules.get(
201
+ mc.metric_schedule.named_schedule.name.strip().lower())
202
+ )
203
+ else:
204
+ log.info(f"Named schedule {mc.metric_schedule.named_schedule.name} "
205
+ f"not found in workspace {client.config.workspace_id}. Creating...")
206
+ ns = client.create_named_schedule(
207
+ name=mc.metric_schedule.named_schedule.name, cron=mc.metric_schedule.named_schedule.cron)
208
+ named_schedules[ns.name.strip().lower()] = ns.id
209
+ mc.metric_schedule.named_schedule = NamedSchedule(id=ns.id)
189
210
 
190
- log.info(mc)
211
+ log.info(f"Updated metric configuration: {mc}")
191
212
 
192
- try:
193
- rmc = client.upsert_metric(
194
- schedule_frequency=mc.schedule_frequency,
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
- )
213
+ rmc = client.upsert_metric(metric_configuration=mc)
212
214
 
213
215
  if update_collections:
214
216
  for c in m.collections:
215
- client.upsert_metric_to_collection(
216
- collection_name=c.display_name, add_metric_ids=[rmc.id]
217
- )
217
+ c_ix[c.display_name].append(rmc.id)
218
+ except KeyError:
219
+ log.warning(f"Table {m.metric_metadata.dataset_name} not found in warehouse {target_warehouse_id}")
220
+ if m.metric_metadata.schema_name == "Bigeye Virtual Schema":
221
+ log.info("Virtual tables must created before migration. "
222
+ "Use commands 'bigeye catalog export-virtual-table' and 'bigeye catalog upsert-virtual-table'"
223
+ " to migrate to current workspace.")
218
224
 
219
225
  except Exception as e:
220
226
  log.exception(f"Error for file: {get_file_name_for_metric(m)}")
221
227
  log.exception(e)
222
228
 
229
+ if c_ix:
230
+ log.info(f"Upserting {len(c_ix)} collections...")
231
+ for name, mids in c_ix.items():
232
+ client.upsert_metric_to_collection(collection_name=name, add_metric_ids=mids)
233
+
234
+
223
235
 
224
236
  @app.command()
225
237
  def upsert(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "bigeye-cli"
3
- version = "0.7.1"
3
+ version = "0.7.3"
4
4
  description = "Bigeye CLI offers developer tools for maintaining your developer workspace."
5
5
  license = "Proprietary"
6
6
  authors = ["Bigeye <support@bigeye.com>"]
File without changes