Skip to content

Commit

Permalink
Merge branch 'main' into materialization-job-strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
shangyian authored Dec 6, 2023
2 parents 650cba8 + e8a41d2 commit e1fabea
Show file tree
Hide file tree
Showing 20 changed files with 1,535 additions and 18 deletions.
3 changes: 3 additions & 0 deletions datajunction-clients/python/tests/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,9 @@ def test_get_dimensions(self, client):
assert {
"name": "foo.bar.dispatcher.company_name",
"type": "string",
"node_name": "foo.bar.dispatcher",
"node_display_name": "Foo: Bar: Dispatcher",
"is_primary_key": False,
"path": [
"foo.bar.repair_order_details.repair_order_id",
"foo.bar.repair_order.dispatcher_id",
Expand Down
3 changes: 3 additions & 0 deletions datajunction-server/datajunction_server/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,9 @@ class DimensionAttributeOutput(SQLModel):
"""

name: str
node_name: Optional[str]
node_display_name: Optional[str]
is_primary_key: bool
type: ColumnType
path: List[str]

Expand Down
4 changes: 4 additions & 0 deletions datajunction-server/datajunction_server/sql/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def get_dimensions(
dimensions.append(
DimensionAttributeOutput(
name=f"{current_node.name}.{column.name}",
node_name=current_node.current.name,
node_display_name=current_node.current.display_name,
is_primary_key=column.name
in {pk.name for pk in current_node.current.primary_key()},
type=column.type,
path=join_path_str,
),
Expand Down
Loading

0 comments on commit e1fabea

Please sign in to comment.