Skip to content

Commit 5b57226

Browse files
committed
format
1 parent c33a055 commit 5b57226

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

sdks/python/src/lqp/proto_validator.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,17 @@ def _unwrap_oneof(node: Message) -> Message | None:
241241
# parse function without consuming any tokens. These share the same parse
242242
# offset as their inner message and must be skipped during offset matching.
243243
_TRANSPARENT_WRAPPERS: set[str] = {
244-
"Declaration", "Instruction", "Formula", "Construct",
245-
"Write", "Read", "Data",
246-
"Term", "Type", "RelTerm", "Monoid",
244+
"Declaration",
245+
"Instruction",
246+
"Formula",
247+
"Construct",
248+
"Write",
249+
"Read",
250+
"Data",
251+
"Term",
252+
"Type",
253+
"RelTerm",
254+
"Monoid",
247255
}
248256

249257

@@ -277,9 +285,7 @@ def _build_span_tree(provenance: dict[int, Any]) -> _SpanNode:
277285
Each span's children are the spans directly contained within it.
278286
Spans are sorted by start offset, with wider spans first for ties.
279287
"""
280-
sorted_items = sorted(
281-
provenance.items(), key=lambda x: (x[0], -x[1].stop.offset)
282-
)
288+
sorted_items = sorted(provenance.items(), key=lambda x: (x[0], -x[1].stop.offset))
283289
sentinel = _SpanNode(-1, None)
284290
stack: list[tuple[_SpanNode, int]] = [(sentinel, 2**63)]
285291
for offset, span in sorted_items:

sdks/python/tests/test_provenance.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def test_provenance_span_ordering():
3333
_, provenance = parse(SIMPLE_INPUT)
3434
for offset, span in provenance.items():
3535
assert span.start.offset <= span.stop.offset, f"Bad span at offset {offset}"
36-
assert span.start.line <= span.stop.line, f"Bad line ordering at offset {offset}"
36+
assert span.start.line <= span.stop.line, (
37+
f"Bad line ordering at offset {offset}"
38+
)
3739

3840

3941
def test_provenance_location_fields():

0 commit comments

Comments
 (0)