Skip to content

Add DOT import - #377

Merged
mattkjames7 merged 14 commits into
mainfrom
dot-import
Mar 5, 2026
Merged

Add DOT import#377
mattkjames7 merged 14 commits into
mainfrom
dot-import

Conversation

@mattkjames7

@mattkjames7 mattkjames7 commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Description

Added ability to import DOT files or a string containing DOT code, e.g.:

import gqlalchemy

importer = GraphImporter(graph_type="NX")
importer.translate_dot_file("ninja-build-graph.dot")

Pull request type

Please delete options that are not relevant.

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring with functional or API changes
  • Refactoring without functional or API changes
  • Build or packaging related changes
  • Documentation content changes
  • Other (please describe):

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

######################################

Reviewer checklist (the reviewer checks this part)

  • Core feature implementation
  • Tests
  • Code documentation
  • Documentation on gqlalchemy/docs

######################################


Note

Medium Risk
Adds a new DOT parsing/import path (via optional pydot) with non-trivial attribute normalization and ID generation, plus CI dependency-install changes that could affect test coverage/compatibility.

Overview
Adds DOT graph import support to GraphImporter (NetworkX mode) via new translate_dot_file()/translate_dot_data() APIs backed by optional pydot, converting DOT graphs into NetworkX and enriching nodes/edges with stable IDs, sequences, sanitized/flattened attributes_* properties, and attributes_json.

Introduces a new dot extra (and includes it in all) in pyproject.toml, updates CI workflows to install explicit extras (including dot) instead of --all-extras, adjusts the TF-GNN install task to also install tf-keras, and adds docs + tests covering DOT import and normalization edge cases (key collisions, multiedges, file/data parsing).

Written by Cursor Bugbot for commit 0e76e7e. This will update automatically on new commits. Configure here.

@mattkjames7 mattkjames7 self-assigned this Feb 27, 2026
@mattkjames7 mattkjames7 added feature feature Docs needed Docs needed labels Feb 27, 2026
@mattkjames7 mattkjames7 added this to the GQLAlchemy 1.9.0 milestone Feb 27, 2026
@mattkjames7
mattkjames7 marked this pull request as ready for review February 27, 2026 17:09
@mattkjames7

Copy link
Copy Markdown
Contributor Author

@cursor review

Comment thread gqlalchemy/transformations/importing/graph_importer.py Outdated
Comment thread gqlalchemy/transformations/importing/graph_importer.py Outdated
cursoragent and others added 2 commits February 27, 2026 17:59
Co-authored-by: Dr Matt James <mattkjames7@users.noreply.github.com>
Co-authored-by: Dr Matt James <mattkjames7@users.noreply.github.com>
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml
Comment thread gqlalchemy/transformations/importing/graph_importer.py
Comment thread tests/transformations/importing/test_import.py
Comment thread gqlalchemy/transformations/importing/graph_importer.py Outdated
Comment thread gqlalchemy/transformations/importing/graph_importer.py
cursoragent and others added 2 commits March 4, 2026 17:33
Co-authored-by: Dr Matt James <mattkjames7@users.noreply.github.com>
Co-authored-by: Dr Matt James <mattkjames7@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread gqlalchemy/transformations/importing/graph_importer.py
@mattkjames7
mattkjames7 merged commit cc140ed into main Mar 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs needed Docs needed feature feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants