PyPI package: https://pypi.org/project/grakn-client
Documentation: https://dev.docs.grakn.ai/docs/client-api/python
Distribution
Available through https://pypi.org
pip install grakn-client==2.0.0-alpha-6
New Features
- **Support new graql update queries**
We synchronised client-python with the current master versions of protocol, behavioural tests, and grakn core server, to enable support for the new update query type, as well as adding support for related tests and automation.
- **Improve Cluster failover algorithm and add a test for it**
We wrote a test for Grakn Cluster failover. Using the test, we improved our failover algorithm, fixing bugs and making it more readable.
- **Grakn Cluster integration**
We now support connecting to Grakn Cluster.
This is a **breaking change.** Creating a `GraknClient` now requires a new syntax:
client = GraknClient.core(address)
To connect to Grakn Cluster, use
client = GraknClient.cluster(address)
The API usage of a Cluster client is the same as for a Core client. It also supports one additional field in `GraknOptions` named `allow_secondary_replica`, which when set to `True` allows **read** transactions to read from secondary database replicas.
- **Add ability to retrieve all rules**
Since Rule was refactored in Grakn 2.0 to no longer be a subtype of Concept, we lost the ability to retrieve all rules using `match $x sub rule; get;`.
So, to allow the user to retrieve all rules, we now add `get_rules` to the `LogicManager`, enabling use of `tx().logic().get_rules()`.
Bugs Fixed
- **Fix 5 second delay before programs using the client actually terminate**
There was a 5 second delay before programs using Client Python actually terminated, caused by a worker thread staying alive for 5 seconds after closing a Session. We changed the thread to a daemon thread, that does not block the program's termination.
- **Make private concept API method public**
We fixed the issue with `get_thing_type` API not being available for the user.
- **Make behaviour tests rerunnable on developer's machine**
Fix rerunning behavioural tests for second time on developers' machines
- **Create one gRPC Channel per session and transaction**
We observed that when using 2 parallel threads to open a large number of transactions, response messages from the server would be intermittently dropped, leading to the client stalling. Creating a separate gRPC Channel for each transaction appears to solve the issue.
- **Fix console warnings caused by out of date dependency**
Fix `WARNING: An illegal reflective access operation has occurred` warning caused by an out of date version of protobuf.
Code Refactors
- **Remove dependency on six library**
As Grakn Client Python is a Python 3-only library, we no longer need to depend on `six` library (which is a compatibility layer between Python 2 and Python 3) and therefore it needs to be removed for better code maintainability and understandability.
- **Update dependency on grakn-protocol**
Depend on Grakn Protocol package by the new name `grakn-protocol` (consistent across all platforms)
What are the changes implemented in this PR?
graknlabs/protocol106 renamed Protocol package deployed to PyPI to `grakn-protocol`. In this PR dependency is upgraded to latest `snapshot` version of `grakn-protocol`.
Other Improvements
- **Reenable remote build caching**
Speed up builds by utilizing remote caching provided by BuildBuddy.
- **Upgrade grpcio to 1.35.0**
Our older version of grpcio was not being successfully installed on all systems. To mitigate these installation issues we upgraded to 1.35.0.
- **Update dependencies and the version**
We have updated `grakn-protocol` to `2.0.0a6`. Additionally, we've updated the version to `2.0.0-alpha-6`.
---
**Please refer to [full release notes of 2.0.0-alpha](https://github.com/graknlabs/client-python/releases/tag/2.0.0-alpha) to see the changes contained in 2.0.0.**