bigeye-cli 0.8.3__tar.gz → 0.8.5__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 (36) hide show
  1. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/PKG-INFO +4 -3
  2. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/CLI_DOCS.md +2 -1
  3. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/bigconfig/bigconfig_commands.py +75 -41
  4. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/lineage/lineage_commands.py +7 -0
  5. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/metric/metric_commands.py +2 -1
  6. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/pyproject.toml +2 -2
  7. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/LICENSE +0 -0
  8. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/__init__.py +0 -0
  9. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/__main__.py +0 -0
  10. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/__version__.py +0 -0
  11. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/bigconfig/__init__.py +0 -0
  12. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/bigconfig/bigconfig_options.py +0 -0
  13. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/catalog/__init__.py +0 -0
  14. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/catalog/catalog_commands.py +0 -0
  15. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/catalog/custom_repo_commands.py +0 -0
  16. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/collections/__init__.py +0 -0
  17. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/collections/collection_commands.py +0 -0
  18. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/configure/__init__.py +0 -0
  19. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/configure/configure_commands.py +0 -0
  20. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/deltas/__init__.py +0 -0
  21. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/deltas/deltas_commands.py +0 -0
  22. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/enums.py +0 -0
  23. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/exceptions/__init__.py +0 -0
  24. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/exceptions/exceptions.py +0 -0
  25. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/functions.py +0 -0
  26. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/global_options.py +0 -0
  27. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/issues/__init__.py +0 -0
  28. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/issues/issue_commands.py +0 -0
  29. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/lineage/__init__.py +0 -0
  30. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/metric/__init__.py +0 -0
  31. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/model/__init__.py +0 -0
  32. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/model/cicd_conf.py +0 -0
  33. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/model/github_report.py +0 -0
  34. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/model/vendor_report.py +0 -0
  35. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/bigeye_cli/workspace/__init__.py +0 -0
  36. {bigeye_cli-0.8.3 → bigeye_cli-0.8.5}/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.8.3
3
+ Version: 0.8.5
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
@@ -12,13 +12,13 @@ Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
14
  Requires-Dist: PyGithub (>=1.59.1,<2.0.0)
15
- Requires-Dist: bigeye-sdk (>=0.11.2,<0.12.0)
15
+ Requires-Dist: bigeye-sdk (>=0.11.3,<0.12.0)
16
16
  Requires-Dist: click (>=8.1.8,<9.0.0)
17
17
  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.8.3
21
+ Version: 0.8.5
22
22
  ## Installation
23
23
 
24
24
  **Setting up your local/build environment**
@@ -2046,6 +2046,7 @@ $ bigeye lineage export-end-to-end [OPTIONS]
2046
2046
  * `--direction [upstream|downstream|both]`: Direction to trace: upstream, downstream, or both. [default: both]
2047
2047
  * `--granularity [schema|table|column]`: Hop level: schema, table, or column. Defaults to each root&#x27;s own level.
2048
2048
  * `--max-paths INTEGER`: Per-root cap on enumerated paths. Truncation is logged, never silent. [default: 10000]
2049
+ * `--include-etl / --no-include-etl`: Include or exclude ETL operator nodes as hops. When excluded, paths are stitched across removed ETL nodes (A -&gt; ETL -&gt; C becomes A -&gt; C). Defaults to including them. [default: include-etl]
2049
2050
  * `--depth INTEGER`: Per-window traversal depth. When set, each root&#x27;s graph is fetched in bounded depth-hop windows, re-rooting at the lineage frontier until the lineage is exhausted end-to-end. This escapes the backend&#x27;s per-request depth ceiling (lineage.max_depth) that truncates a single full fetch, and keeps each request small so very large graphs don&#x27;t fail. Omit to request the graph in one call (the previous behavior, capped at the backend depth limit).
2050
2051
  * `--concurrency INTEGER`: Max concurrent window requests when --depth is used. Lower it to reduce client memory and server load on wide graphs. Ignored without --depth. [default: 8]
2051
2052
  * `-o, --output TEXT`: Output .csv path. Defaults to end_to_end_&lt;root&gt;.csv in the current directory.
@@ -1,5 +1,5 @@
1
1
  # **Bigeye CLI**
2
- Version: 0.8.3
2
+ Version: 0.8.5
3
3
  ## Installation
4
4
 
5
5
  **Setting up your local/build environment**
@@ -2027,6 +2027,7 @@ $ bigeye lineage export-end-to-end [OPTIONS]
2027
2027
  * `--direction [upstream|downstream|both]`: Direction to trace: upstream, downstream, or both. [default: both]
2028
2028
  * `--granularity [schema|table|column]`: Hop level: schema, table, or column. Defaults to each root&#x27;s own level.
2029
2029
  * `--max-paths INTEGER`: Per-root cap on enumerated paths. Truncation is logged, never silent. [default: 10000]
2030
+ * `--include-etl / --no-include-etl`: Include or exclude ETL operator nodes as hops. When excluded, paths are stitched across removed ETL nodes (A -&gt; ETL -&gt; C becomes A -&gt; C). Defaults to including them. [default: include-etl]
2030
2031
  * `--depth INTEGER`: Per-window traversal depth. When set, each root&#x27;s graph is fetched in bounded depth-hop windows, re-rooting at the lineage frontier until the lineage is exhausted end-to-end. This escapes the backend&#x27;s per-request depth ceiling (lineage.max_depth) that truncates a single full fetch, and keeps each request small so very large graphs don&#x27;t fail. Omit to request the graph in one call (the previous behavior, capped at the backend depth limit).
2031
2032
  * `--concurrency INTEGER`: Max concurrent window requests when --depth is used. Lower it to reduce client memory and server load on wide graphs. Ignored without --depth. [default: 8]
2032
2033
  * `-o, --output TEXT`: Output .csv path. Defaults to end_to_end_&lt;root&gt;.csv in the current directory.
@@ -2,7 +2,7 @@ import os
2
2
  import warnings
3
3
  from datetime import datetime
4
4
  from pathlib import Path
5
- from typing import Optional, List
5
+ from typing import Optional, List, Dict
6
6
 
7
7
  import typer
8
8
 
@@ -11,9 +11,12 @@ from bigeye_cli import global_options
11
11
  from bigeye_cli.bigconfig import bigconfig_options
12
12
  from bigeye_cli.model.github_report import GitHubReport
13
13
  from bigeye_sdk.bigconfig_validation.big_config_reports import all_reports
14
- from bigeye_sdk.controller.metric_controller import MetricController
14
+ from bigeye_sdk.controller.metric_controller import MetricController, filter_metrics_by_namespace
15
+ from bigeye_sdk.functions.file_functs import sanitize_filename
15
16
  from bigeye_sdk.controller.metric_suite_controller import MetricSuiteController
16
- from bigeye_sdk.generated.com.bigeye.models.generated import MetricInfoList, MetricInfo
17
+ from bigeye_sdk.generated.com.bigeye.models.generated import (
18
+ MetricInfoList, MetricInfo
19
+ )
17
20
  from bigeye_sdk.model.big_config import BigConfig
18
21
  from bigeye_sdk.model.protobuf_message_facade import SimpleCollection
19
22
  from bigeye_sdk.log import get_logger
@@ -191,6 +194,14 @@ def export(
191
194
  "collection id (-cid), table id (-tid), or list of metric ids (-mid). "
192
195
  )
193
196
 
197
+ # Collect the SQL (custom) rules in scope up front. A scope can contain only SQL
198
+ # rules and no metrics, so both the table guard below and the main "nothing to
199
+ # export" guard consult this to avoid bailing out before the rules are exported.
200
+ # `namespace` scopes the rules the same way it scopes metrics below.
201
+ sql_rule_deployments = mc.collect_sql_rule_deployments(
202
+ collection_id=collection_id, table_id=table_id, namespace=namespace
203
+ )
204
+
194
205
  # Add metric ids if passed
195
206
  if metric_ids:
196
207
  final_metric_ids.extend(metric_ids)
@@ -208,66 +219,80 @@ def export(
208
219
  table_ids=[table_id]
209
220
  ).metrics
210
221
  final_metric_ids.extend([m.metric_configuration.id for m in metrics_from_table])
211
- if not metrics_from_table:
222
+ if not metrics_from_table and not sql_rule_deployments:
212
223
  raise typer.BadParameter(
213
- f"No metrics found for given table id. Please check arguments and try again."
224
+ f"No metrics or SQL rules found for given table id. Please check arguments and try again."
214
225
  )
215
- if not collection_id:
226
+ if metrics_from_table and not collection_id:
216
227
  collection.name = metrics_from_table[0].metric_metadata.dataset_name
217
228
 
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)
229
+ # Pull raw metric info. Converting to protobuf objects complicates default and zero values
230
+ # unnecessarily. NOTE: the API treats an empty metric_ids list as "no filter" and returns
231
+ # every metric in the workspace, so only fetch when at least one metric is in scope --
232
+ # otherwise a metrics-less scope (e.g. a collection of only SQL rules) would export everything.
233
+ raw_metrics: List[dict] = (
234
+ client.get_metric_info_batch_post(metric_ids=final_metric_ids, return_raw_response=True)
235
+ if final_metric_ids
236
+ else []
237
+ )
221
238
 
239
+ # `namespace` is used ONLY to filter which metrics get exported. It is
240
+ # intentionally NOT written into the generated bigconfig file (nor the shared
241
+ # SMD library): the SMD library is reused across every namespace and must stay
242
+ # namespace-agnostic, and combine_bigconfigs() fails an apply where one file
243
+ # carries a namespace and another does not. Users re-scope on apply by passing
244
+ # `--namespace` (see the reminder printed after export).
222
245
  if namespace:
223
246
  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)
247
+ raw_metrics = filter_metrics_by_namespace(raw_metrics, namespace)
230
248
  log.info(f"{len(raw_metrics)} metrics found in namespace: {namespace}")
231
249
 
232
250
  if not output_path:
233
251
  output_path = client.config.bigconfig_output_path or Path.cwd()
234
252
 
235
- if not raw_metrics:
253
+ if not raw_metrics and not sql_rule_deployments:
236
254
  raise typer.BadParameter(
237
- "No metrics found for given arguments. Please check again."
255
+ "No metrics or SQL rules found for given arguments. Please check again."
238
256
  )
239
257
 
258
+ if raw_metrics:
259
+ if not use_v1:
260
+ mc.infos_to_convert = raw_metrics
261
+ template_smds = mc.collect_template_smds_from_inputs()
262
+ mc.write_or_update_smd_library(
263
+ template_smds_from_inputs=template_smds, auto_apply=auto_apply_on_indexing
264
+ )
265
+ typer.secho(
266
+ f"\nUpdated SMD library at: {mc.saved_metric_def_path}\n", fg="green", bold=True
267
+ )
240
268
 
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)
269
+ if smd_only:
270
+ raise typer.Exit(0)
253
271
 
254
- bc = mc.to_bigconfig_yaml(collection=collection, auto_apply_on_indexing=auto_apply_on_indexing)
272
+ bc = mc.to_bigconfig_yaml(collection=collection, auto_apply_on_indexing=auto_apply_on_indexing)
255
273
 
256
- # Dumping **kwargs messes up the formatting
257
- bigconfig = BigConfig(type=bc["type"])
274
+ # Dumping **kwargs messes up the formatting
275
+ bigconfig = BigConfig(type=bc["type"])
258
276
 
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")
277
+ if bc.get("auto_apply_on_indexing", None):
278
+ bigconfig.auto_apply_on_indexing = True
279
+ if bc.get("tag_definitions", None):
280
+ bigconfig.tag_definitions = bc.get("tag_definitions")
263
281
 
264
- bigconfig.tag_deployments = bc.get("tag_deployments")
282
+ bigconfig.tag_deployments = bc.get("tag_deployments")
283
+ else:
284
+ bigconfig = mc.metric_info_to_bigconfig(
285
+ metric_info=MetricInfoList(metrics=[MetricInfo().from_dict(m) for m in raw_metrics]), collection=collection
286
+ )
265
287
  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
- )
288
+ # Only SQL rules are in scope: emit a minimal bigconfig carrying just the rules.
289
+ bigconfig = BigConfig(type='BIGCONFIG_FILE')
290
+
291
+ # Export custom (SQL) rules in scope alongside the metrics, in the same format apply reads.
292
+ if sql_rule_deployments:
293
+ bigconfig.sql_rules = sql_rule_deployments
269
294
 
270
- file_name = collection.name.lower().replace(" ", "_")
295
+ file_name = sanitize_filename(collection.name)
271
296
  output = bigconfig.save(
272
297
  output_path=output_path,
273
298
  default_file_name=f"{file_name}.bigconfig",
@@ -276,3 +301,12 @@ def export(
276
301
  typer.secho(
277
302
  f"\nBigconfig file generated at: {output}\n", fg="green", bold=True
278
303
  )
304
+
305
+ if namespace:
306
+ typer.secho(
307
+ f"These metrics were exported from the '{namespace}' namespace. The namespace is "
308
+ f"intentionally omitted from the generated file(s) so the shared SMD library stays "
309
+ f"namespace-agnostic. To preserve it on apply, pass the namespace explicitly, e.g.:\n"
310
+ f" bigeye bigconfig apply -n {namespace} ...\n",
311
+ fg="yellow",
312
+ )
@@ -366,6 +366,12 @@ def export_end_to_end(
366
366
  "--max-paths",
367
367
  help="Per-root cap on enumerated paths. Truncation is logged, never silent.",
368
368
  ),
369
+ include_etl: bool = typer.Option(
370
+ True,
371
+ "--include-etl/--no-include-etl",
372
+ help="Include or exclude ETL operator nodes as hops. When excluded, paths are stitched "
373
+ "across removed ETL nodes (A -> ETL -> C becomes A -> C). Defaults to including them.",
374
+ ),
369
375
  depth: Optional[int] = typer.Option(
370
376
  None,
371
377
  "--depth",
@@ -411,6 +417,7 @@ def export_end_to_end(
411
417
  max_paths=max_paths,
412
418
  depth=depth,
413
419
  concurrency=concurrency,
420
+ include_etl=include_etl,
414
421
  )
415
422
 
416
423
  log.info(
@@ -17,6 +17,7 @@ from bigeye_cli.enums import MetricFileType
17
17
  from bigeye_sdk.controller.metric_controller import MetricController
18
18
  from bigeye_sdk.functions.metric_functions import get_file_name_for_metric
19
19
  from bigeye_sdk.functions.bigconfig_functions import build_fq_name
20
+ from bigeye_sdk.functions.file_functs import sanitize_filename
20
21
  from bigeye_sdk.model.dbt_schema import (
21
22
  SimpleDbtSchema,
22
23
  relationships_test_names,
@@ -458,7 +459,7 @@ def dbt_tests_to_metrics(
458
459
  bigconfig = BigConfig.tag_deployments_to_bigconfig(
459
460
  tag_deployments=tag_deployments, collection=collection
460
461
  )
461
- file_name = collection.name.lower().replace(" ", "_")
462
+ file_name = sanitize_filename(collection.name)
462
463
  if not output_path:
463
464
  output_path = Path.cwd()
464
465
  output = bigconfig.save(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "bigeye-cli"
3
- version = "0.8.3"
3
+ version = "0.8.5"
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.11.0"
21
21
  click = "^8.1.8"
22
- bigeye-sdk = "^0.11.2"
22
+ bigeye-sdk = "^0.11.3"
23
23
  rich = "^14.1.0"
24
24
  PyGithub = '^1.59.1'
25
25
 
File without changes