Skip to content

Commit b318180

Browse files
committed
Fixes
1 parent 0d731ee commit b318180

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/pdl/pdl_ast.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ class LocationType(BaseModel):
6161
class LocalizedExpression(BaseModel):
6262
"""Expression with location information"""
6363

64-
model_config = ConfigDict(extra="forbid", use_attribute_docstrings=True)
64+
model_config = ConfigDict(
65+
extra="forbid", use_attribute_docstrings=True, arbitrary_types_allowed=True
66+
)
6567
expr: Any
6668
location: Optional[LocationType] = None
6769
pdl_yaml_src: Optional[YamlSource] = None
@@ -106,7 +108,11 @@ class ContributeTarget(StrEnum):
106108
class Block(BaseModel):
107109
"""Common fields for all PDL blocks."""
108110

109-
model_config = ConfigDict(extra="forbid", use_attribute_docstrings=True)
111+
model_config = ConfigDict(
112+
extra="forbid",
113+
use_attribute_docstrings=True,
114+
arbitrary_types_allowed=True,
115+
)
110116

111117
description: Optional[str] = None
112118
"""Documentation associated to the block.

src/pdl/pdl_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def parse_str(pdl_str: str, file_name: str = "") -> tuple[Program, LocationType]
4141

4242

4343
def set_program_location(prog: Program, pdl_str: str, file_name: str = ""):
44-
loc = strictyaml.dirty_load(pdl_str)
44+
loc = strictyaml.dirty_load(pdl_str, allow_flow_style=True)
4545
set_location(prog.root, loc)
4646

4747

0 commit comments

Comments
 (0)