PyPI package: https://pypi.org/project/grakn-client
Documentation: https://dev.grakn.ai/docs/client-api/python
Distribution
Available through https://pypi.org
pip install grakn-client
Or you can upgrade your local installation with:
pip install -U grakn-client
New Features
- **Retrievable Explanations.**
As of https://github.com/graknlabs/grakn/pull/5483, Grakn Core now:
1. has retrievable explanation trees
2. only the `ConceptMap` answer type has `Explanation`
3. `pattern` has moved from `Explanation` to `ConceptMap`
4. `pattern` contains IDs for each variable as well as the query pattern
These changes are reflected in client python, as long with a `has_explanation()` method on `ConceptMap`.
- **Delete Queries return Void Answer Type, add Concept.is_deleted().**
As of https://github.com/graknlabs/protocol/pull/18, we have decided in a slight paradigm shift with `delete` queries:
1. straight delete queries `match...; delete...;` only return a message rather than the halfway house of all deleted Concept IDs (this was always awkward, should either return a Concept -- hard because vertex deleted, or nothing. We have opted for nothing).
2. If you want to know what was deleted, this implies your behavior was a _retrieve_ followed by a _delete_. This retrieve should be performed explicltly by the user not implicitly by Grakn, ie. a `match...; get...;` followed by `delete` using Concept API, or using a separate `match...; delete;` query.
Also, new method `is_deleted()` exists on all `Concept` as part of the Concept API.
Bugs Fixed
- **Refactor how version is provided to Python deployment rules.**
graknlabs/bazel-distribution195 changed how version is provided to `assemble_pip`. This PR adapts `client-python` to these changes.
- **Fix CI by using Python 2 to run tests.**
Until `rules_python` properly support installing Python 3 packages, we switch running Python tests back to Python 2
Code Refactors
- **Refactor how version is provided to deploy_github rule.**
Adapt `graknlabs_client_python` to latest changes in bazel-distribution (in particular, graknlabs/bazel-distribution150)
Other Improvements
- **Rename is_closed to is_open.**
To bring client-python in line with client-java, we rename the negative `tx.is_closed()` to the positive `tx.is_open()`.
- **Use release-validate-deps to ensure that client-python depends on a released version of protocol.**
We have added a validation step using `//ci:release-validate-deps` in order to ensure that client-python is releasable only if it depends on a released version of protocol
- **Adapt to latest graknlabs_bazel_distribution.**
Newest changes in `bazel-distribution` (graknlabs/bazel-distribution181) are backwards-incompatible.