bigeye-cli 0.5.1__tar.gz → 0.6.0__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.5.1 → bigeye_cli-0.6.0}/PKG-INFO +7 -3
  2. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/CLI_DOCS.md +5 -1
  3. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/bigconfig/bigconfig_commands.py +64 -10
  4. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/functions.py +8 -14
  5. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/metric/metric_commands.py +9 -10
  6. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/pyproject.toml +2 -2
  7. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/LICENSE +0 -0
  8. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/__init__.py +0 -0
  9. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/__main__.py +0 -0
  10. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/__version__.py +0 -0
  11. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/bigconfig/__init__.py +0 -0
  12. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/bigconfig/bigconfig_options.py +0 -0
  13. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/catalog/__init__.py +0 -0
  14. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/catalog/catalog_commands.py +0 -0
  15. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/collections/__init__.py +0 -0
  16. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/collections/collection_commands.py +0 -0
  17. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/configure/__init__.py +0 -0
  18. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/configure/configure_commands.py +0 -0
  19. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/deltas/__init__.py +0 -0
  20. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/deltas/deltas_commands.py +0 -0
  21. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/enums.py +0 -0
  22. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/exceptions/__init__.py +0 -0
  23. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/exceptions/exceptions.py +0 -0
  24. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/global_options.py +0 -0
  25. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/issues/__init__.py +0 -0
  26. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/issues/issue_commands.py +0 -0
  27. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/lineage/__init__.py +0 -0
  28. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/lineage/lineage_commands.py +0 -0
  29. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/metric/__init__.py +0 -0
  30. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/model/__init__.py +0 -0
  31. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/model/cicd_conf.py +0 -0
  32. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/model/github_report.py +0 -0
  33. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/model/vendor_report.py +0 -0
  34. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/bigeye_cli/workspace/__init__.py +0 -0
  35. {bigeye_cli-0.5.1 → bigeye_cli-0.6.0}/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.5.1
3
+ Version: 0.6.0
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
@@ -13,13 +13,13 @@ Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Requires-Dist: PyGithub (>=1.59.1,<2.0.0)
16
- Requires-Dist: bigeye-sdk (>=0.6.0,<0.7.0)
16
+ Requires-Dist: bigeye-sdk (>=0.7.0,<0.8.0)
17
17
  Requires-Dist: click (>=8.1.8,<9.0.0)
18
18
  Requires-Dist: rich (>=14.1.0,<15.0.0)
19
19
  Description-Content-Type: text/markdown
20
20
 
21
21
  # **Bigeye CLI**
22
- Version: 0.5.1
22
+ Version: 0.6.0
23
23
  ## Installation
24
24
 
25
25
  **Setting up your local/build environment**
@@ -681,9 +681,13 @@ $ bigeye bigconfig export [OPTIONS]
681
681
  * `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
682
682
  * `-op, --output_path TEXT`: Output path where reports and fixme files will be saved. If no output path is defined then current working directory will be used.
683
683
  * `-n, --namespace TEXT`: The namespace for the deployment. (This must match across all files or namespace should not be set in files)
684
+ * `-add_auto, --auto_apply_on_indexing`: Adds section to output
685
+ * `-smd_path, --smd-library_path TEXT`: Path to the Saved Metric Definition library. [default: saved_metric_definitions.yaml]
686
+ * `--smd-only`: Only export metrics to the Saved Metric Definition library
684
687
  * `-cid, --collection_id INTEGER`: Collection ID of metrics to be exported.
685
688
  * `-tid, --table_id INTEGER`: Table ID of metrics to be exported.
686
689
  * `-mid, --metric_id INTEGER`: Metric ID of metrics to be exported.
690
+ * `-v1, --use_v1`: Export metrics using the v1 converter (not recommended).
687
691
  * `--help`: Show this message and exit.
688
692
 
689
693
  # `bigeye catalog`
@@ -1,5 +1,5 @@
1
1
  # **Bigeye CLI**
2
- Version: 0.5.1
2
+ Version: 0.6.0
3
3
  ## Installation
4
4
 
5
5
  **Setting up your local/build environment**
@@ -661,9 +661,13 @@ $ bigeye bigconfig export [OPTIONS]
661
661
  * `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
662
662
  * `-op, --output_path TEXT`: Output path where reports and fixme files will be saved. If no output path is defined then current working directory will be used.
663
663
  * `-n, --namespace TEXT`: The namespace for the deployment. (This must match across all files or namespace should not be set in files)
664
+ * `-add_auto, --auto_apply_on_indexing`: Adds section to output
665
+ * `-smd_path, --smd-library_path TEXT`: Path to the Saved Metric Definition library. [default: saved_metric_definitions.yaml]
666
+ * `--smd-only`: Only export metrics to the Saved Metric Definition library
664
667
  * `-cid, --collection_id INTEGER`: Collection ID of metrics to be exported.
665
668
  * `-tid, --table_id INTEGER`: Table ID of metrics to be exported.
666
669
  * `-mid, --metric_id INTEGER`: Metric ID of metrics to be exported.
670
+ * `-v1, --use_v1`: Export metrics using the v1 converter (not recommended).
667
671
  * `--help`: Show this message and exit.
668
672
 
669
673
  # `bigeye catalog`
@@ -1,4 +1,6 @@
1
1
  import os
2
+ import warnings
3
+ from datetime import datetime
2
4
  from pathlib import Path
3
5
  from typing import Optional, List
4
6
 
@@ -11,7 +13,8 @@ from bigeye_cli.model.github_report import GitHubReport
11
13
  from bigeye_sdk.bigconfig_validation.big_config_reports import all_reports
12
14
  from bigeye_sdk.controller.metric_controller import MetricController
13
15
  from bigeye_sdk.controller.metric_suite_controller import MetricSuiteController
14
- from bigeye_sdk.generated.com.bigeye.models.generated import MetricInfoList
16
+ from bigeye_sdk.generated.com.bigeye.models.generated import MetricInfoList, MetricInfo
17
+ from bigeye_sdk.model.big_config import BigConfig
15
18
  from bigeye_sdk.model.protobuf_message_facade import SimpleCollection
16
19
  from bigeye_sdk.log import get_logger
17
20
 
@@ -145,6 +148,18 @@ def export(
145
148
  workspace: str = global_options.workspace,
146
149
  output_path: str = bigconfig_options.output_path,
147
150
  namespace: Optional[str] = bigconfig_options.namespace,
151
+ auto_apply_on_indexing: bool = typer.Option(
152
+ False, "--auto_apply_on_indexing", "-add_auto", help="Adds section to output"
153
+ ),
154
+ smd_library_path: str = typer.Option(
155
+ "saved_metric_definitions.yaml",
156
+ "--smd-library_path",
157
+ "-smd_path",
158
+ help="Path to the Saved Metric Definition library."
159
+ ),
160
+ smd_only: bool = typer.Option(
161
+ False, "--smd-only", help="Only export metrics to the Saved Metric Definition library"
162
+ ),
148
163
  collection_id: int = typer.Option(
149
164
  None, "--collection_id", "-cid", help="Collection ID of metrics to be exported."
150
165
  ),
@@ -154,13 +169,17 @@ def export(
154
169
  metric_ids: List[int] = typer.Option(
155
170
  None, "--metric_id", "-mid", help="Metric ID of metrics to be exported."
156
171
  ),
172
+ use_v1: bool = typer.Option(
173
+ False, "--use_v1", "-v1", help="Export metrics using the v1 converter (not recommended)."
174
+ )
157
175
  ):
158
176
  """Exports existing metrics into a valid Bigconfig file."""
159
177
 
160
178
  client = cli_client_factory(bigeye_conf, config_file, workspace)
161
- mc = MetricController(client=client)
179
+ mc = MetricController(client=client, saved_metric_definitions_path=smd_library_path)
180
+
162
181
  collection: SimpleCollection = SimpleCollection(
163
- name="Sample", description="SDK Generated"
182
+ name=f"CLI Export {datetime.today().strftime('%Y%m%d')}", description="SDK Generated"
164
183
  )
165
184
 
166
185
  final_metric_ids: List[int] = []
@@ -196,22 +215,57 @@ def export(
196
215
  if not collection_id:
197
216
  collection.name = metrics_from_table[0].metric_metadata.dataset_name
198
217
 
199
- # Pull metric information
200
- metrics: MetricInfoList = client.get_metric_info_batch_post(metric_ids=final_metric_ids)
218
+ # Pull raw metric info. Converting to protobuf objects complicates default and zero values unnecessarily
219
+ raw_metrics: List[dict] = client.get_metric_info_batch_post(metric_ids=final_metric_ids,
220
+ return_raw_response=True)
201
221
 
202
222
  if namespace:
203
- infos = metrics.metrics
204
- metrics = MetricInfoList(metrics=[m for m in infos if m.metric_configuration.bigconfig_namespace == namespace])
223
+ log.info(f"Filtering metrics that only reside in the namespace: {namespace}")
224
+ raw_metrics = []
225
+ # 2025-09-26: Some metric configs don't have the key 'bigconfigNamespace' in them
226
+ for m in raw_metrics:
227
+ cfg = m.get("metricConfiguration")
228
+ if "bigconfigNamespace" in cfg and cfg.get("bigconfigNamespace") == namespace:
229
+ raw_metrics.append(m)
230
+ log.info(f"{len(raw_metrics)} metrics found in namespace: {namespace}")
205
231
 
206
232
  if not output_path:
207
233
  output_path = client.config.bigconfig_output_path or Path.cwd()
208
234
 
209
- if not metrics.metrics:
235
+ if not raw_metrics:
210
236
  raise typer.BadParameter(
211
237
  "No metrics found for given arguments. Please check again."
212
238
  )
213
239
 
214
- bigconfig = mc.metric_info_to_bigconfig(metric_info=metrics, collection=collection)
240
+
241
+ if not use_v1:
242
+ mc.infos_to_convert = raw_metrics
243
+ template_smds = mc.collect_template_smds_from_inputs()
244
+ mc.write_or_update_smd_library(
245
+ template_smds_from_inputs=template_smds, auto_apply=auto_apply_on_indexing
246
+ )
247
+ typer.secho(
248
+ f"\nUpdated SMD library at: {mc.saved_metric_def_path}\n", fg="green", bold=True
249
+ )
250
+
251
+ if smd_only:
252
+ raise typer.Exit(0)
253
+
254
+ bc = mc.to_bigconfig_yaml(collection=collection, auto_apply_on_indexing=auto_apply_on_indexing)
255
+
256
+ # Dumping **kwargs messes up the formatting
257
+ bigconfig = BigConfig(type=bc["type"])
258
+
259
+ if bc.get("auto_apply_on_indexing", None):
260
+ bigconfig.auto_apply_on_indexing = True
261
+ if bc.get("tag_definitions", None):
262
+ bigconfig.tag_definitions = bc.get("tag_definitions")
263
+
264
+ bigconfig.tag_deployments = bc.get("tag_deployments")
265
+ else:
266
+ bigconfig = mc.metric_info_to_bigconfig(
267
+ metric_info=MetricInfoList(metrics=[MetricInfo().from_dict(m) for m in raw_metrics]), collection=collection
268
+ )
215
269
 
216
270
  file_name = collection.name.lower().replace(" ", "_")
217
271
  output = bigconfig.save(
@@ -220,5 +274,5 @@ def export(
220
274
  custom_formatter=bigconfig.format_bigconfig_export,
221
275
  )
222
276
  typer.secho(
223
- f"\nSample bigconfig file generated at: {output}\n", fg="green", bold=True
277
+ f"\nBigconfig file generated at: {output}\n", fg="green", bold=True
224
278
  )
@@ -1,12 +1,12 @@
1
1
  import enum
2
- import json
2
+
3
3
  import os
4
4
  from typing import List, Dict, Optional
5
5
  import typer
6
6
  import yaml
7
7
  from rich.prompt import Prompt
8
8
  from rich import print
9
- from rich.table import Table
9
+
10
10
  from rich.text import Text
11
11
 
12
12
  from bigeye_sdk.class_ext.enum_ext import StrEnum
@@ -199,9 +199,7 @@ def write_metric_templates(output_path: str, metric_templates: List[MetricTempla
199
199
  serialize_list_to_json_file(url=url, data=metric_templates)
200
200
 
201
201
 
202
- def write_yaml_templates(
203
- metric_templates: List[MetricTemplate], output_path: Optional[str] = None, file_name: str = None
204
- ):
202
+ def write_yaml_templates(metric_templates: List[MetricTemplate], output_path: Optional[str] = None):
205
203
  if not output_path:
206
204
  output_path = os.getcwd()
207
205
 
@@ -235,7 +233,7 @@ def run_enum_menu(enum_clz: enum.EnumMeta, default: StrEnum) -> StrEnum:
235
233
  f"Which authorization method would you like to use? "
236
234
  f"(Default: {valid_type_by_type[default]})", default=valid_type_by_type[default])
237
235
  )
238
- except ValueError as e:
236
+ except ValueError:
239
237
  pass
240
238
 
241
239
  if user_chosen_type_ix not in valid_types.keys():
@@ -274,7 +272,7 @@ def verify_email_access_for_workspace(cred: ApiAuth, workspace_id: int, bigeye_u
274
272
  workspace_emails = get_allowed_emails_for_workspace(cred=cred, workspace_id=workspace_id)
275
273
  while bigeye_username.lower() not in workspace_emails:
276
274
  print(Text(text=f"{no_access}\n{please_verify}", style='bold yellow'))
277
- workspace_id = Prompt.ask(f"Enter Bigeye workspace ID")
275
+ workspace_id = int(Prompt.ask(f"Enter Bigeye workspace ID"))
278
276
  workspace_emails = get_allowed_emails_for_workspace(cred=cred, workspace_id=workspace_id)
279
277
  return workspace_id
280
278
 
@@ -294,7 +292,7 @@ def get_workspace_id_for_user(
294
292
 
295
293
  workspace_id = Prompt.ask(f"Enter Bigeye workspace ID for desired {workspace} configuration",
296
294
  choices=[str(w.id) for w in all_workspaces])
297
- workspace_id = verify_email_access_for_workspace(cred=cred, workspace_id=workspace_id,
295
+ workspace_id = verify_email_access_for_workspace(cred=cred, workspace_id=int(workspace_id),
298
296
  bigeye_username=bigeye_username)
299
297
  return {
300
298
  "workspace_id": workspace_id,
@@ -302,9 +300,7 @@ def get_workspace_id_for_user(
302
300
  }
303
301
 
304
302
 
305
- def write_named_schedules(
306
- schedules: List[NamedSchedule], output_path: Optional[str] = None, file_name: Optional[str] = None
307
- ):
303
+ def write_named_schedules(schedules: List[NamedSchedule], output_path: Optional[str] = None):
308
304
  if not output_path:
309
305
  output_path = os.getcwd()
310
306
  else:
@@ -316,9 +312,7 @@ def write_named_schedules(
316
312
  yaml.dump({"schedule_name": s.name, "cron": s.cron}, outfile, default_flow_style=False)
317
313
 
318
314
 
319
- def write_virtual_tables(
320
- virtual_tables: List[VirtualTable], output_path: Optional[str] = None, file_name: Optional[str] = None
321
- ):
315
+ def write_virtual_tables(virtual_tables: List[VirtualTable], output_path: Optional[str] = None):
322
316
 
323
317
  if not output_path:
324
318
  output_path = os.getcwd()
@@ -1,4 +1,5 @@
1
1
  # create logger
2
+ import warnings
2
3
  from os import listdir
3
4
  from os.path import join, isfile
4
5
  from typing import List, Dict
@@ -168,22 +169,19 @@ def upsert_from_path(
168
169
  table_names = {m.metric_metadata.dataset_name for m in mil.metrics}
169
170
  schema_names = {m.metric_metadata.schema_name for m in mil.metrics}
170
171
 
171
- tables: TableList = client.get_tables(
172
+ tables: List[Table] = client.get_tables(
172
173
  warehouse_id=[target_warehouse_id],
173
174
  schema=list(schema_names),
174
175
  table_name=list(table_names),
175
- )
176
+ ).tables
176
177
 
177
- t_ix: Dict[str, Table] = {t.name: t for t in tables.tables}
178
+ t_ix: Dict[str, Table] = {t.name: t for t in tables}
178
179
 
179
180
  if set_row_creation_time:
180
- rct_cols = {
181
- m.metric_metadata.dataset_time_column_name
182
- for m in mil.metrics
183
- if m.metric_metadata.dataset_time_column_name
184
- }
185
- client.set_table_metric_times(
186
- column_names=rct_cols, table_ids=[t.id for t in tables.tables], replace=True
181
+ warnings.warn(
182
+ "set_row_creation_time is deprecated and will be removed in a future version. "
183
+ "Row creation time is managed in the metricConfiguration with the 'rctOverride' field.",
184
+ DeprecationWarning
187
185
  )
188
186
 
189
187
  for m in mil.metrics:
@@ -209,6 +207,7 @@ def upsert_from_path(
209
207
  muted_until_epoch_seconds=mc.muted_until_epoch_seconds,
210
208
  name=mc.name,
211
209
  description=mc.description,
210
+ rct_override=mc.rct_override
212
211
  )
213
212
 
214
213
  if update_collections:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "bigeye-cli"
3
- version = "0.5.1"
3
+ version = "0.6.0"
4
4
  description = "Bigeye CLI offers developer tools for maintaining your developer workspace."
5
5
  license = "Proprietary"
6
6
  authors = ["Bigeye <support@bigeye.com>"]
@@ -19,7 +19,7 @@ bigeye = "bigeye_cli.__main__:app"
19
19
  [tool.poetry.dependencies]
20
20
  python = "^3.9.0"
21
21
  click = "^8.1.8"
22
- bigeye-sdk = "^0.6.0"
22
+ bigeye-sdk = "^0.7.0"
23
23
  rich = "^14.1.0"
24
24
  PyGithub = '^1.59.1'
25
25
 
File without changes