bigeye-cli 0.7.2__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.2 → bigeye_cli-0.7.3}/PKG-INFO +5 -5
  2. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/CLI_DOCS.md +4 -4
  3. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/catalog/catalog_commands.py +3 -3
  4. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/metric/metric_commands.py +23 -10
  5. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/pyproject.toml +1 -1
  6. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/LICENSE +0 -0
  7. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/__init__.py +0 -0
  8. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/__main__.py +0 -0
  9. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/__version__.py +0 -0
  10. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/bigconfig/__init__.py +0 -0
  11. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/bigconfig/bigconfig_commands.py +0 -0
  12. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/bigconfig/bigconfig_options.py +0 -0
  13. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/catalog/__init__.py +0 -0
  14. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/collections/__init__.py +0 -0
  15. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/collections/collection_commands.py +0 -0
  16. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/configure/__init__.py +0 -0
  17. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/configure/configure_commands.py +0 -0
  18. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/deltas/__init__.py +0 -0
  19. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/deltas/deltas_commands.py +0 -0
  20. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/enums.py +0 -0
  21. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/exceptions/__init__.py +0 -0
  22. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/exceptions/exceptions.py +0 -0
  23. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/functions.py +0 -0
  24. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/global_options.py +0 -0
  25. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/issues/__init__.py +0 -0
  26. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/issues/issue_commands.py +0 -0
  27. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/lineage/__init__.py +0 -0
  28. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/lineage/lineage_commands.py +0 -0
  29. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/metric/__init__.py +0 -0
  30. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/model/__init__.py +0 -0
  31. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/model/cicd_conf.py +0 -0
  32. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/model/github_report.py +0 -0
  33. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/model/vendor_report.py +0 -0
  34. {bigeye_cli-0.7.2 → bigeye_cli-0.7.3}/bigeye_cli/workspace/__init__.py +0 -0
  35. {bigeye_cli-0.7.2 → 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.2
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.2
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.2
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
@@ -16,7 +17,6 @@ from bigeye_cli.enums import MetricFileType
16
17
  from bigeye_sdk.controller.metric_controller import MetricController
17
18
  from bigeye_sdk.functions.metric_functions import get_file_name_for_metric
18
19
  from bigeye_sdk.functions.bigconfig_functions import build_fq_name
19
- from bigeye_sdk.generated.com.bigeye.models._generated_root import NamedSchedule
20
20
  from bigeye_sdk.model.dbt_schema import (
21
21
  SimpleDbtSchema,
22
22
  relationships_test_names,
@@ -37,9 +37,10 @@ from bigeye_cli.functions import (
37
37
  from bigeye_sdk.generated.com.bigeye.models.generated import (
38
38
  MetricInfoList,
39
39
  MetricInfo,
40
- TableList,
41
40
  Table,
42
41
  MetricConfiguration,
42
+ NamedSchedule,
43
+ TemplateMetric
43
44
  )
44
45
  from bigeye_sdk.model.big_config import BigConfig, TagDeployment, ColumnSelector
45
46
  from bigeye_sdk.model.metric_facade import SimpleUpsertMetricRequest
@@ -177,6 +178,7 @@ def upsert_from_path(
177
178
  ).tables
178
179
 
179
180
  t_ix: Dict[str, Table] = {t.name: t for t in tables}
181
+ c_ix: Dict[str, List[int]] = defaultdict(list)
180
182
 
181
183
  if set_row_creation_time:
182
184
  warnings.warn(
@@ -201,9 +203,10 @@ def upsert_from_path(
201
203
  else:
202
204
  log.info(f"Named schedule {mc.metric_schedule.named_schedule.name} "
203
205
  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
206
-
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)
207
210
 
208
211
  log.info(f"Updated metric configuration: {mc}")
209
212
 
@@ -211,14 +214,24 @@ def upsert_from_path(
211
214
 
212
215
  if update_collections:
213
216
  for c in m.collections:
214
- client.upsert_metric_to_collection(
215
- collection_name=c.display_name, add_metric_ids=[rmc.id]
216
- )
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.")
217
224
 
218
225
  except Exception as e:
219
226
  log.exception(f"Error for file: {get_file_name_for_metric(m)}")
220
227
  log.exception(e)
221
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
+
222
235
 
223
236
  @app.command()
224
237
  def upsert(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "bigeye-cli"
3
- version = "0.7.2"
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