Skip to content

Commit

Permalink
walk schema for traversable nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Jan 9, 2025
1 parent d74b551 commit b8bd0eb
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions asdf/_node_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,11 @@ def from_root_node(
if root_info is None:
root_info = info

if parent is None:
info.schema = schema

if parent is not None:
# Why check that __asdf_traverse__ doesn't exist here?
# If the parent has a schema and the identifier is in
# the schema we have a valid subschema for this node.
# Why does it matter if it does or doesn't support
# __asdf_traverse__ (as that only determines the
# children).
if parent.schema is not None and not traversable:
if parent.schema is not None:
# descend within the schema of the parent
info.set_schema_for_property(parent, identifier)

Expand All @@ -433,9 +430,6 @@ def from_root_node(
# be using _tag for a non-ASDF purpose.
pass

if parent is None:
info.schema = schema

# add children to queue
for child_identifier, child_node in get_children(t_node):
next_nodes.append((info, child_identifier, child_node))
Expand Down

0 comments on commit b8bd0eb

Please sign in to comment.