Skip to content

Commit

Permalink
Fix a scalar type dependecy bug.
Browse files Browse the repository at this point in the history
Scalar types didn't trace dependecies based on their base types.
  • Loading branch information
vpetrovykh committed Feb 1, 2024
1 parent 6e7a350 commit cb3d6ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions edb/edgeql/declarative.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,15 @@ def trace_layout_Schema(
trace_layout(decl, ctx=ctx)


@trace_layout.register
def trace_layout_CreateScalarType(
node: qlast.CreateScalarType,
*,
ctx: LayoutTraceContext,
) -> None:
_trace_item_layout(node, ctx=ctx)


@trace_layout.register
def trace_layout_CreateObjectType(
node: qlast.CreateObjectType,
Expand Down
8 changes: 8 additions & 0 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,14 @@ def test_schema_rewrite_order_01(self):
}
"""

def test_schema_scalar_order_01(self):
# Make sure scalar types account for base types when tracing SDL
# dependencies.
"""
scalar type two extending one;
scalar type one extending str;
"""

def test_schema_property_cardinality_alter_01(self):
schema = self.load_schema('''
type Foo {
Expand Down

0 comments on commit cb3d6ca

Please sign in to comment.