Skip to content

Commit

Permalink
Set access model node args (#7966)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Jun 27, 2023
1 parent a84fa50 commit fcd30b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230627-152528.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: add access to ModelNodeArgs for external node building
time: 2023-06-27T15:25:28.488767-04:00
custom:
Author: michelleark
Issue: "7890"
2 changes: 2 additions & 0 deletions core/dbt/contracts/graph/node_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Optional, List

from dbt.contracts.graph.unparsed import NodeVersion
from dbt.node_types import AccessType


@dataclass
Expand All @@ -16,6 +17,7 @@ class ModelNodeArgs:
version: Optional[NodeVersion] = None
latest_version: Optional[NodeVersion] = None
deprecation_date: Optional[datetime] = None
access: Optional[str] = AccessType.Protected.value
generated_at: datetime = field(default_factory=datetime.utcnow)
depends_on_nodes: List[str] = field(default_factory=list)
enabled: bool = True
1 change: 1 addition & 0 deletions core/dbt/contracts/graph/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ def from_args(cls, args: ModelNodeArgs) -> "ModelNode":
alias=args.identifier,
deprecation_date=args.deprecation_date,
checksum=FileHash.from_contents(f"{unique_id},{args.generated_at}"),
access=AccessType(args.access),
original_file_path="",
path="",
depends_on=DependsOn(nodes=args.depends_on_nodes),
Expand Down
1 change: 1 addition & 0 deletions core/dbt/parser/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ def build_external_nodes(self) -> List[ModelNodeArgs]:
schema=public_node.schema,
identifier=public_node.identifier,
deprecation_date=public_node.deprecation_date,
access=AccessType.Public,
)
)

Expand Down

0 comments on commit fcd30b1

Please sign in to comment.