Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update thrift files #184

Merged
merged 8 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions .github/workflows/deploy_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@ jobs:
pip3 install setuptools wheel twine
pip install .
pip install -r requirements/dev.txt
- name: Test with pytest
run: |
docker-compose up -d
sleep 45
pytest -s -v -k "not TestSSLConnection and not TestSSLConnectionSelfSigned"
docker-compose down -v
working-directory: tests
- name: Test SSL connection with pytest
run: |
enable_ssl=true docker-compose up -d
sleep 45
pytest -s -v test_ssl_connection.py::TestSSLConnection
working-directory: tests
- name: Test self-signed SSL connection with pytest
run: |
enable_ssl=true docker-compose up -d
sleep 45
pytest -s -v test_ssl_connection.py::TestSSLConnectionSelfSigned
working-directory: tests
- name: Test with pytest
run: |
docker-compose up -d
sleep 45
pytest -s -v -k "not TestSSLConnection and not TestSSLConnectionSelfSigned"
docker-compose down -v
working-directory: tests
- name: Test SSL connection with pytest
run: |
enable_ssl=true docker-compose up -d
sleep 45
pytest -s -v test_ssl_connection.py::TestSSLConnection
working-directory: tests
- name: Test self-signed SSL connection with pytest
run: |
enable_ssl=true docker-compose up -d
sleep 45
pytest -s -v test_ssl_connection.py::TestSSLConnectionSelfSigned
working-directory: tests

- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_NAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 setup.py sdist bdist_wheel
twine upload dist/*
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_NAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 setup.py sdist bdist_wheel
twine upload dist/*
2 changes: 1 addition & 1 deletion nebula2/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@



from .ttypes import UTF8STRINGS, NullType, PropertyType, ErrorCode, SchemaID, Date, Time, DateTime, Value, NList, NMap, NSet, Row, DataSet, Coordinate, Point, LineString, Polygon, Geography, Tag, Vertex, Edge, Step, Path, HostAddr, KeyValue, LogInfo, DirInfo, NodeInfo, PartitionBackupInfo, CheckpointInfo, LogEntry, ClusterID, GraphSpaceID, PartitionID, TagID, EdgeType, EdgeRanking, LogID, TermID, Timestamp, IndexID, Port, SessionID, ExecutionPlanID
from .ttypes import UTF8STRINGS, NullType, PropertyType, ErrorCode, SchemaID, Date, Time, DateTime, Value, NList, NMap, NSet, Row, DataSet, Coordinate, Point, LineString, Polygon, Geography, Tag, Vertex, Edge, Step, Path, HostAddr, KeyValue, Duration, LogInfo, DirInfo, NodeInfo, PartitionBackupInfo, CheckpointInfo, LogEntry, ClusterID, GraphSpaceID, PartitionID, TagID, EdgeType, EdgeRanking, LogID, TermID, Timestamp, IndexID, Port, SessionID, ExecutionPlanID

version = "2.6.0"

142 changes: 138 additions & 4 deletions nebula2/common/ttypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
all_structs = []
UTF8STRINGS = bool(0) or sys.version_info.major >= 3

__all__ = ['UTF8STRINGS', 'NullType', 'PropertyType', 'ErrorCode', 'SchemaID', 'Date', 'Time', 'DateTime', 'Value', 'NList', 'NMap', 'NSet', 'Row', 'DataSet', 'Coordinate', 'Point', 'LineString', 'Polygon', 'Geography', 'Tag', 'Vertex', 'Edge', 'Step', 'Path', 'HostAddr', 'KeyValue', 'LogInfo', 'DirInfo', 'NodeInfo', 'PartitionBackupInfo', 'CheckpointInfo', 'LogEntry', 'ClusterID', 'GraphSpaceID', 'PartitionID', 'TagID', 'EdgeType', 'EdgeRanking', 'LogID', 'TermID', 'Timestamp', 'IndexID', 'Port', 'SessionID', 'ExecutionPlanID']
__all__ = ['UTF8STRINGS', 'NullType', 'PropertyType', 'ErrorCode', 'SchemaID', 'Date', 'Time', 'DateTime', 'Value', 'NList', 'NMap', 'NSet', 'Row', 'DataSet', 'Coordinate', 'Point', 'LineString', 'Polygon', 'Geography', 'Tag', 'Vertex', 'Edge', 'Step', 'Path', 'HostAddr', 'KeyValue', 'Duration', 'LogInfo', 'DirInfo', 'NodeInfo', 'PartitionBackupInfo', 'CheckpointInfo', 'LogEntry', 'ClusterID', 'GraphSpaceID', 'PartitionID', 'TagID', 'EdgeType', 'EdgeRanking', 'LogID', 'TermID', 'Timestamp', 'IndexID', 'Port', 'SessionID', 'ExecutionPlanID']

class NullType:
__NULL__ = 0
Expand Down Expand Up @@ -76,6 +76,7 @@ class PropertyType:
INT16 = 9
INT32 = 10
TIMESTAMP = 21
DURATION = 23
DATE = 24
DATETIME = 25
TIME = 26
Expand All @@ -94,6 +95,7 @@ class PropertyType:
9: "INT16",
10: "INT32",
21: "TIMESTAMP",
23: "DURATION",
24: "DATE",
25: "DATETIME",
26: "TIME",
Expand All @@ -113,6 +115,7 @@ class PropertyType:
"INT16": 9,
"INT32": 10,
"TIMESTAMP": 21,
"DURATION": 23,
"DATE": 24,
"DATETIME": 25,
"TIME": 26,
Expand All @@ -133,7 +136,7 @@ class ErrorCode:
E_TAG_PROP_NOT_FOUND = -10
E_ROLE_NOT_FOUND = -11
E_CONFIG_NOT_FOUND = -12
E_GROUP_NOT_FOUND = -13
E_MACHINE_NOT_FOUND = -13
E_ZONE_NOT_FOUND = -14
E_LISTENER_NOT_FOUND = -15
E_PART_NOT_FOUND = -16
Expand Down Expand Up @@ -256,7 +259,7 @@ class ErrorCode:
-10: "E_TAG_PROP_NOT_FOUND",
-11: "E_ROLE_NOT_FOUND",
-12: "E_CONFIG_NOT_FOUND",
-13: "E_GROUP_NOT_FOUND",
-13: "E_MACHINE_NOT_FOUND",
-14: "E_ZONE_NOT_FOUND",
-15: "E_LISTENER_NOT_FOUND",
-16: "E_PART_NOT_FOUND",
Expand Down Expand Up @@ -380,7 +383,7 @@ class ErrorCode:
"E_TAG_PROP_NOT_FOUND": -10,
"E_ROLE_NOT_FOUND": -11,
"E_CONFIG_NOT_FOUND": -12,
"E_GROUP_NOT_FOUND": -13,
"E_MACHINE_NOT_FOUND": -13,
"E_ZONE_NOT_FOUND": -14,
"E_LISTENER_NOT_FOUND": -15,
"E_PART_NOT_FOUND": -16,
Expand Down Expand Up @@ -3237,6 +3240,107 @@ def __ne__(self, other):
if not six.PY2:
__hash__ = object.__hash__

class Duration:
"""
Attributes:
- seconds
- microseconds
- months
"""

thrift_spec = None
thrift_field_annotations = None
thrift_struct_annotations = None
__init__ = None
@staticmethod
def isUnion():
return False

def read(self, iprot):
if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None:
fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)
return
if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None:
fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.I64:
self.seconds = iprot.readI64()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.I32:
self.microseconds = iprot.readI32()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.I32:
self.months = iprot.readI32()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()

def write(self, oprot):
if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None:
oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0))
return
if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None:
oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2))
return
oprot.writeStructBegin('Duration')
if self.seconds != None:
oprot.writeFieldBegin('seconds', TType.I64, 1)
oprot.writeI64(self.seconds)
oprot.writeFieldEnd()
if self.microseconds != None:
oprot.writeFieldBegin('microseconds', TType.I32, 2)
oprot.writeI32(self.microseconds)
oprot.writeFieldEnd()
if self.months != None:
oprot.writeFieldBegin('months', TType.I32, 3)
oprot.writeI32(self.months)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()

def __repr__(self):
L = []
padding = ' ' * 4
if self.seconds is not None:
value = pprint.pformat(self.seconds, indent=0)
value = padding.join(value.splitlines(True))
L.append(' seconds=%s' % (value))
if self.microseconds is not None:
value = pprint.pformat(self.microseconds, indent=0)
value = padding.join(value.splitlines(True))
L.append(' microseconds=%s' % (value))
if self.months is not None:
value = pprint.pformat(self.months, indent=0)
value = padding.join(value.splitlines(True))
L.append(' months=%s' % (value))
return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '')

def __eq__(self, other):
if not isinstance(other, self.__class__):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
return not (self == other)

# Override the __hash__ function for Python3 - t10434117
if not six.PY2:
__hash__ = object.__hash__

class LogInfo:
"""
Attributes:
Expand Down Expand Up @@ -4517,6 +4621,36 @@ def KeyValue__setstate__(self, state):
KeyValue.__getstate__ = lambda self: self.__dict__.copy()
KeyValue.__setstate__ = KeyValue__setstate__

all_structs.append(Duration)
Duration.thrift_spec = (
None, # 0
(1, TType.I64, 'seconds', None, None, 2, ), # 1
(2, TType.I32, 'microseconds', None, None, 2, ), # 2
(3, TType.I32, 'months', None, None, 2, ), # 3
)

Duration.thrift_struct_annotations = {
"cpp.type": "nebula::Duration",
}
Duration.thrift_field_annotations = {
}

def Duration__init__(self, seconds=None, microseconds=None, months=None,):
self.seconds = seconds
self.microseconds = microseconds
self.months = months

Duration.__init__ = Duration__init__

def Duration__setstate__(self, state):
state.setdefault('seconds', None)
state.setdefault('microseconds', None)
state.setdefault('months', None)
self.__dict__ = state

Duration.__getstate__ = lambda self: self.__dict__.copy()
Duration.__setstate__ = Duration__setstate__

all_structs.append(LogInfo)
LogInfo.thrift_spec = (
None, # 0
Expand Down
2 changes: 2 additions & 0 deletions nebula2/graph/GraphService-remote
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ FUNCTIONS = {
'authenticate': Function('authenticate', 'GraphService', 'AuthResponse', [('binary', 'username', 'binary'), ('binary', 'password', 'binary')]),
'signout': Function('signout', 'GraphService', None, [('i64', 'sessionId', 'i64')]),
'execute': Function('execute', 'GraphService', 'ExecutionResponse', [('i64', 'sessionId', 'i64'), ('binary', 'stmt', 'binary')]),
'executeWithParameter': Function('executeWithParameter', 'GraphService', 'ExecutionResponse', [('i64', 'sessionId', 'i64'), ('binary', 'stmt', 'binary'), ('map<binary, common.Value>', 'parameterMap', 'map<binary, common.Value>')]),
'executeJson': Function('executeJson', 'GraphService', 'binary', [('i64', 'sessionId', 'i64'), ('binary', 'stmt', 'binary')]),
'executeJsonWithParameter': Function('executeJsonWithParameter', 'GraphService', 'binary', [('i64', 'sessionId', 'i64'), ('binary', 'stmt', 'binary'), ('map<binary, common.Value>', 'parameterMap', 'map<binary, common.Value>')]),
'verifyClientVersion': Function('verifyClientVersion', 'GraphService', 'VerifyClientVersionResp', [('VerifyClientVersionReq', 'req', 'VerifyClientVersionReq')]),
}

Expand Down
Loading