Skip to content

Commit

Permalink
add project_name to manifest metadata (#7754)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk authored Jun 2, 2023
1 parent 05b0ebb commit 7917bd5
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 196 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20230601-132223.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: add project_name to manifest metadata
time: 2023-06-01T13:22:23.259448-04:00
custom:
Author: michelleark jtcohen6
Issue: "7752"
6 changes: 5 additions & 1 deletion core/dbt/config/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ def from_args(cls, args: Any) -> "RuntimeConfig":
)

def get_metadata(self) -> ManifestMetadata:
return ManifestMetadata(project_id=self.hashed_name(), adapter_type=self.credentials.type)
return ManifestMetadata(
project_name=self.project_name,
project_id=self.hashed_name(),
adapter_type=self.credentials.type,
)

def _get_v2_config_paths(
self,
Expand Down
8 changes: 7 additions & 1 deletion core/dbt/contracts/graph/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,16 @@ class ManifestMetadata(BaseArtifactMetadata):
dbt_schema_version: str = field(
default_factory=lambda: str(WritableManifest.dbt_schema_version)
)
project_name: Optional[str] = field(
default=None,
metadata={
"description": "Name of the root project",
},
)
project_id: Optional[str] = field(
default=None,
metadata={
"description": "A unique identifier for the project",
"description": "A unique identifier for the project, hashed from the project name",
},
)
user_id: Optional[UUID] = field(
Expand Down
Loading

0 comments on commit 7917bd5

Please sign in to comment.