Skip to content

feat: Build for Python 3.14#383

Open
mattkjames7 wants to merge 49 commits intomainfrom
feat/python-3.14
Open

feat: Build for Python 3.14#383
mattkjames7 wants to merge 49 commits intomainfrom
feat/python-3.14

Conversation

@mattkjames7
Copy link
Copy Markdown
Contributor

@mattkjames7 mattkjames7 commented Apr 1, 2026

Description

This PR updates gqlalchemy for Python 3.14 readiness by combining CI/dependency compatibility updates with the previously merged Pydantic v2 API migration #384. It broadens test coverage across newer Python versions, adjusts optional dependency markers for unsupported stacks (notably TensorFlow/TF-GNN on newer interpreters), and keeps OGM behavior stable for normal Node/Relationship usage.

Most users should not need code changes. One edge case remains: nullable (Optional[...]) fields may accept omitted values as None where strict “required but nullable” validation was previously relied on.

Added a short smoke-test of gqlalchemy in macOS and restored tests for Windows in CI.

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):

Related issues

Delete section if this PR doesn't resolve any issues.

Closes (link to issue)

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

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

@mattkjames7 mattkjames7 self-assigned this Apr 1, 2026
@antejavor antejavor added the enhancement enhancement label Apr 3, 2026
@mattkjames7 mattkjames7 mentioned this pull request Apr 7, 2026
18 tasks
@mattkjames7 mattkjames7 modified the milestone: GQLAlchemy 1.9.0 Apr 7, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR targets Python 3.14 readiness by updating CI matrices and dependency markers, and aligning GQLAlchemy’s OGM internals/tests with Pydantic v2 APIs while preserving historical OGM behavior (notably around omitted nullable fields).

Changes:

  • Expand CI coverage up through Python 3.14 and adjust test selection/extras installation per interpreter.
  • Update OGM internals and tests to use Pydantic v2 APIs (model_fields, model_validate, field_validator) and add compatibility helpers for field metadata.
  • Refine dependency markers for optional stacks (TensorFlow/TF-GNN, PyArrow) and update docs to reflect modern Python support and Pydantic-v2 usage.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/transformations/translators/test_tfgnn_transformations.py Switch TF/TF-GNN imports to importorskip and add tfgnn markers.
tests/ogm/test_validators.py Migrate validators to Pydantic v2 field_validator and adjust list validation logic.
tests/ogm/test_properties.py Replace __fields__ assertions with model_fields.
tests/ogm/test_loading.py Use Pydantic v2 ValidationError import.
tests/ogm/test_custom_fields.py Use GQLAlchemy Field wrapper instead of Pydantic v1 Field.
tests/ogm/test_class_definition.py Replace __fields__ assertions with model_fields.
tests/docs/test_ogm.py Add module-level skip for Python 3.14+ due to behavior mismatch.
pyproject.toml Add Python-version markers for pandas/TF stacks and update optional extras markers.
gqlalchemy/vendors/memgraph.py Update on-disk property handling to use model-field helpers/attrs.
gqlalchemy/models.py Implement Pydantic v2 migration helpers, Field wrapper metadata, and model_validate flow.
gqlalchemy/connection.py Switch parse_obj usages to model_validate.
gqlalchemy/__init__.py Update exported validator import to Pydantic v2 location.
docs/reference/gqlalchemy/models.md Document parse_obj compatibility and recommend model_validate.
docs/installation.md Update supported Python statement and clarify optional-extras availability.
docs/index.md Update support note to include Python 3.14 and extras caveats.
docs/how-to-guides/ogm.md Add note about omitted nullable fields being treated as None.
.github/workflows/build-and-test.yml Expand Python matrices, add dispatch inputs, split dependency installs and test runs by Python version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/transformations/translators/test_tfgnn_transformations.py Outdated
Comment thread tests/ogm/test_validators.py Outdated
Comment thread tests/docs/test_ogm.py Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml
Comment thread .github/workflows/build-and-test.yml Outdated
Comment thread .github/workflows/build-and-test.yml Outdated
@mattkjames7 mattkjames7 marked this pull request as ready for review April 8, 2026 16:37
@mattkjames7 mattkjames7 linked an issue Apr 8, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@antejavor antejavor left a comment

Choose a reason for hiding this comment

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

Massive improvements all around the places (python support, win, macos build) , with a minor downside in compatibility.

I guess at some point we will ditch most of the dependencies out and move to Memgraph QM ->GNN/TGNN, being an example, since we now have this ->https://github.com/memgraph/memgraph/blob/master/mage/python/gnn.py

That means dependencies can live inside the mage container, keeping clients cleaner and leaner. 🦾

Comment thread .github/workflows/build-and-test.yml Outdated
Comment thread .github/workflows/build-and-test.yml
Comment thread .github/workflows/build-and-test.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Python 3.14

3 participants