Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr-mcp-neo4j-data-modeling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install dependencies
run: |
cd servers/mcp-neo4j-data-modeling
uv venv
uv venv --python ${{ matrix.python-version }}
uv pip install -e ".[dev]"

- name: Check format and linting
Expand Down
2 changes: 2 additions & 0 deletions servers/mcp-neo4j-data-modeling/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Next

### Fixed
* Fixed bug in f-string formatting with Pydantic model export in Python v < 3.12
* Fixed bug in the data modeling Github action that didn't actually test different Python versions due to not specifying the version when executing uv commands.

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,12 @@ def to_pydantic_model_str(self) -> str:
escaped_desc = self.description.replace('"""', r"\"\"\"")
docstring = f'\n """{escaped_desc}"""'

# Extract newline to avoid backslash in f-string
props_joined = "\n ".join(props)
return f"""class {self.label}(BaseModel):{docstring}
node_label: ClassVar[str] = \"{self.label}\"

{"\n ".join(props)}"""
{props_joined}"""

def to_neo4j_graphrag_python_package_node_dict(self) -> dict[str, str]:
"""
Expand Down Expand Up @@ -661,7 +663,9 @@ def to_pydantic_model_str(
docstring = f'\n """{escaped_desc}"""'

# Build properties section with proper indentation
props_section = f"\n {'\n '.join(props)}\n" if props else ""
# Extract newline to avoid backslash in f-string
props_joined = '\n '.join(props)
props_section = f"\n {props_joined}\n" if props else ""

return f"""class {type_pascal_case}(BaseModel):{docstring}
relationship_type: ClassVar[str] = \"{self.type}\"
Expand Down