Skip to content

Commit

Permalink
rebased on main and added new partial parsing event
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel May committed Nov 9, 2021
1 parent 683190b commit 31acb95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions core/dbt/events/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,14 @@ def message(self) -> str:
return "Unable to do partial parsing because env vars used in profiles.yml have changed"


@dataclass
class PartialParsingDeletedMetric(DebugLevel, Cli, File):
id: str

def message(self) -> str:
return f"Partial parsing: deleted metric {self.id}"


@dataclass
class ManifestWrongMetadataVersion(DebugLevel, Cli, File):
version: str
Expand Down Expand Up @@ -2253,6 +2261,7 @@ def dump_callable():
PartialParsingFailedBecauseProfileChange()
PartialParsingFailedBecauseNewProjectDependency()
PartialParsingFailedBecauseHashChanged()
PartialParsingDeletedMetric('')
ParsedFileLoadFailed(path='', exc=Exception(''))
PartialParseSaveFileNotFound()
StaticParserCausedJinjaRendering(path='')
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/parser/partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
PartialParsingEnabled, PartialParsingAddedFile, PartialParsingDeletedFile,
PartialParsingUpdatedFile, PartialParsingNodeMissingInSourceFile, PartialParsingMissingNodes,
PartialParsingChildMapMissingUniqueID, PartialParsingUpdateSchemaFile,
PartialParsingDeletedSource, PartialParsingDeletedExposure
PartialParsingDeletedSource, PartialParsingDeletedExposure, PartialParsingDeletedMetric
)
from dbt.node_types import NodeType

Expand Down Expand Up @@ -870,7 +870,7 @@ def delete_schema_metric(self, schema_file, metric_dict):
self.deleted_manifest.metrics[unique_id] = \
self.saved_manifest.metrics.pop(unique_id)
schema_file.metrics.remove(unique_id)
logger.debug(f"Partial parsing: deleted metric {unique_id}")
fire_event(PartialParsingDeletedMetric(id=unique_id))

def get_schema_element(self, elem_list, elem_name):
for element in elem_list:
Expand Down

0 comments on commit 31acb95

Please sign in to comment.