Skip to content

Commit

Permalink
Update ga thrift files and version (#92)
Browse files Browse the repository at this point in the history
* update ga thrift files

* modify the version

* update
  • Loading branch information
laura-ding authored Mar 22, 2021
1 parent 7348e3f commit db5e244
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,6 @@ while resp.has_next():
| Nebula2-Python Version | NebulaGraph Version |
|---|---|
| 2.0.0.post1 | 2.0.0beta |
| 2.0.0rc1 | 2.0.0-RC1 |
| 2.0.0rc1 | 2.0.0-rc1 |
| 2.0.0ga | 2.0.0-ga |

14 changes: 11 additions & 3 deletions example/GraphClientSimpleExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.

import sys
import time


from nebula2.gclient.net import ConnectionPool
from nebula2.Config import Config
from FormatResp import print_resp
Expand All @@ -34,13 +32,23 @@
time.sleep(6)

# insert vertex
resp = client.execute('INSERT VERTEX person(name, age) VALUES "Bob":("Bob", 10)')
resp = client.execute('INSERT VERTEX person(name, age) VALUES "Bob":("Bob", 10), "Lily":("Lily", 9)')
assert resp.is_succeeded(), resp.error_msg()

# Insert edges
client.execute('INSERT EDGE like(likeness) VALUES "Bob"->"Lily":(80.0);')
assert resp.is_succeeded(), resp.error_msg()

assert resp.is_succeeded(), resp.error_msg()

resp = client.execute('FETCH PROP ON person "Bob"')
assert resp.is_succeeded(), resp.error_msg()
print_resp(resp)

resp = client.execute('FETCH PROP ON like "Bob"->"Lily"')
assert resp.is_succeeded(), resp.error_msg()
print_resp(resp)

except Exception as x:
import traceback
print(traceback.format_exc())
Expand Down
3 changes: 3 additions & 0 deletions nebula2/graph/ttypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class ErrorCode:
E_BAD_PERMISSION = -11
E_SEMANTIC_ERROR = -12
E_TOO_MANY_CONNECTIONS = -13
E_PARTIAL_SUCCEEDED = -14

_VALUES_TO_NAMES = {
0: "SUCCEEDED",
Expand All @@ -64,6 +65,7 @@ class ErrorCode:
-11: "E_BAD_PERMISSION",
-12: "E_SEMANTIC_ERROR",
-13: "E_TOO_MANY_CONNECTIONS",
-14: "E_PARTIAL_SUCCEEDED",
}

_NAMES_TO_VALUES = {
Expand All @@ -81,6 +83,7 @@ class ErrorCode:
"E_BAD_PERMISSION": -11,
"E_SEMANTIC_ERROR": -12,
"E_TOO_MANY_CONNECTIONS": -13,
"E_PARTIAL_SUCCEEDED": -14,
}

class ProfilingStats:
Expand Down
10 changes: 4 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@

setup(
name='nebula2-python',
version='2.0.0rc1',
version='2.0.0ga',
license="Apache 2.0 + Common Clause 1.0",
author='vesoft-inc',
author_email='[email protected]',
long_description='Python client for Nebula Graph V2.0',
url='https://github.com/vesoft-inc/nebula-python',
install_requires=['httplib2',
'future',
'six',
'futures; python_version == "2.7"'],
'six'],
packages=find_packages(),
platforms=["2.7, 3.5, 3.7"],
package_dir={'nebula2': 'nebula2',
'thirft': 'thirft'},
platforms=["3.5, 3.7"],
package_dir={'nebula2': 'nebula2'},
)

0 comments on commit db5e244

Please sign in to comment.