Skip to content

Commit 7df0534

Browse files
authored
chore(sqlmesh): disable unneeded audits (#5488)
1 parent b36ebe5 commit 7df0534

File tree

8 files changed

+33
-26
lines changed

8 files changed

+33
-26
lines changed

warehouse/metrics_tools/factory/factory.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ def generate_models(self, calling_file: str):
351351
)
352352

353353
# Generate the models
354-
355354
for _, query_config, dependencies in self.generate_ordered_queries():
356355
self.generate_model_for_rendered_query(
357356
calling_file, query_config, dependencies
@@ -395,7 +394,11 @@ def generate_models(self, calling_file: str):
395394
"model_metrics_type=timeseries_union",
396395
f"entity_category={entity_type}",
397396
],
398-
audits=self.audits,
397+
# We don't need to run the audits on the views so we are hackily
398+
# disabling this for now. This needs a bigger refactor to clean
399+
# this up
400+
# audits=self.audits,
401+
ignored_rules=["nomissingaudits"],
399402
)(join_all_of_entity_type)
400403

401404
for entity_type, tables in self._key_metrics_marts_tables.items():
@@ -429,7 +432,11 @@ def generate_models(self, calling_file: str):
429432
"model_stage=intermediate",
430433
f"entity_category={entity_type}",
431434
],
432-
audits=self.audits,
435+
# We don't need to run the audits on the views so we are hackily
436+
# disabling this for now. This needs a bigger refactor to clean
437+
# this up
438+
# audits=self.audits,
439+
ignored_rules=["nomissingaudits"],
433440
)(join_all_of_entity_type)
434441

435442
raw_table_metadata = {

warehouse/oso_sqlmesh/models/intermediate/entities/artifacts/blockchain/contracts/int_derived_contracts.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
MODEL (
22
name oso.int_derived_contracts,
33
kind VIEW,
4-
audits (
5-
has_at_least_n_rows(threshold := 0)
6-
)
4+
ignored_rules (
5+
"nomissingaudits",
6+
),
77
);
88

99
SELECT

warehouse/oso_sqlmesh/models/intermediate/entities/artifacts/blockchain/factories/int_factories.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
MODEL (
22
name oso.int_factories,
33
kind VIEW,
4-
audits (
5-
has_at_least_n_rows(threshold := 0)
6-
)
4+
ignored_rules (
5+
"nomissingaudits",
6+
),
77
);
88

99
SELECT

warehouse/oso_sqlmesh/models/intermediate/entities/artifacts/packages/deps-dev/int_packages__current_maintainer_only.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
MODEL (
22
name oso.int_packages__current_maintainer_only,
33
kind VIEW,
4-
audits (
5-
has_at_least_n_rows(threshold := 0)
6-
)
4+
ignored_rules (
5+
"nomissingaudits",
6+
),
77
);
88

99
SELECT DISTINCT

warehouse/oso_sqlmesh/models/intermediate/entities/artifacts/packages/int_code_dependencies.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ MODEL (
22
name oso.int_code_dependencies,
33
description 'Maps GitHub artifacts to the GitHub artifacts they depend on',
44
kind VIEW,
5-
audits (
6-
has_at_least_n_rows(threshold := 0)
7-
)
5+
ignored_rules (
6+
"nomissingaudits",
7+
),
88
);
99

1010
SELECT DISTINCT

warehouse/oso_sqlmesh/models/intermediate/entities/artifacts/packages/ossd-sbom/int_sbom__latest_snapshot.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ MODEL (
22
name oso.int_sbom__latest_snapshot,
33
description 'The most recent snapshot of SBOMs linked to package owner GitHub repos',
44
kind VIEW,
5-
audits (
6-
has_at_least_n_rows(threshold := 0)
7-
)
5+
ignored_rules (
6+
"nomissingaudits",
7+
),
88
);
99

1010
WITH latest_repo_snapshot AS (

warehouse/oso_sqlmesh/models/marts/entities/contracts_v0.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ MODEL (
44
tags (
55
'export'
66
),
7-
audits (
8-
has_at_least_n_rows(threshold := 0)
9-
),
107
column_descriptions (
118
deployment_date = 'The date of a contract deployment',
129
contract_address = 'The address of the contract',
@@ -15,7 +12,10 @@ MODEL (
1512
factory_address = 'The address of the factory that deployed the contract, if this is the same as the originating address then this was a direct deployment by an EOA',
1613
root_deployer_address = 'The EOA address that is considered the root deployer of the contract. If the contract was deployed directly by an EOA, this should be the same as the originating address, if the contract was deployed by a factory this is the creator of the factory.',
1714
sort_weight = 'A weight used for sorting contracts. At this time, this is the tx count of the last 180 days'
18-
)
15+
),
16+
ignored_rules (
17+
"nomissingaudits",
18+
),
1919
);
2020

2121
SELECT

warehouse/oso_sqlmesh/models/marts/metrics/timeseries_metrics_by_artifact_v0.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ MODEL (
66
'model_category=metrics',
77
'model_stage=mart'
88
),
9-
audits (
10-
has_at_least_n_rows(threshold := 0)
11-
),
129
description 'Many-to-many table between metrics, artifacts, and dates. Each row represents the value of a specific metric for a given artifact on a particular date, capturing how that metric changes over time. This is one of the most important models for OSO and should be used frequently in analysis. However, in order to use this table correctly, it is necessary to join on metrics_v0 and artifacts_v1 (or other artifact-related tables). Business questions that can be answered include: Which artifacts have the most active developers? How many forks does this artifact have?',
1310
column_descriptions (
1411
metric_id = 'The unique identifier for the metric, generated by OSO.',
1512
artifact_id = 'The unique identifier for the artifact, as generated by OSO.',
1613
sample_date = 'The date when the metric was sampled, truncated to the day.',
1714
amount = 'The value of the metric for the artifact on the sample date.',
1815
unit = 'The unit of measurement for the metric, if applicable.'
19-
)
16+
),
17+
ignored_rules (
18+
"nomissingaudits",
19+
),
2020
);
2121

2222
WITH all_key_metrics_by_artifact AS (

0 commit comments

Comments
 (0)