PyStellarDB 0.13.2__py2.py3-none-any.whl → 0.13.3__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyStellarDB-0.13.2.dist-info → PyStellarDB-0.13.3.dist-info}/METADATA +1 -1
- PyStellarDB-0.13.3.dist-info/RECORD +10 -0
- pystellardb/_version.py +3 -3
- pystellardb/stellar_hive.py +25 -0
- PyStellarDB-0.13.2.dist-info/RECORD +0 -10
- {PyStellarDB-0.13.2.dist-info → PyStellarDB-0.13.3.dist-info}/LICENSE +0 -0
- {PyStellarDB-0.13.2.dist-info → PyStellarDB-0.13.3.dist-info}/WHEEL +0 -0
- {PyStellarDB-0.13.2.dist-info → PyStellarDB-0.13.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
pystellardb/__init__.py,sha256=JOl41NviMN-qDV0Z8ZPmhNIxvgyauGGJHdB4A-8MhqM,93
|
2
|
+
pystellardb/_version.py,sha256=2iFaCSwa5w1cA0YClojifvj3E-5S5CD6Q-k0gqktj-Y,498
|
3
|
+
pystellardb/graph_types.py,sha256=j9ZEvnTVRFOttg28rcYvOFzfoOBJcRxXxySKIzEcR-I,13098
|
4
|
+
pystellardb/stellar_hive.py,sha256=xVnONjG03CLNwW3dymR2ZqXiEUvcMlIvPIOxzyoDFfE,15067
|
5
|
+
pystellardb/stellar_rdd.py,sha256=TYwsWYeCxfOliGq1kV3ArNXdye55cKWZF7s9M9nDdt4,1324
|
6
|
+
PyStellarDB-0.13.3.dist-info/LICENSE,sha256=1qDFxrywejs7xNBfOr6T-7lOuqDgSNIES77kTYege3w,560
|
7
|
+
PyStellarDB-0.13.3.dist-info/METADATA,sha256=TOwRH-egbNXByXlJPL7-gp3SGhHUiJ8xQb7GVilrVv0,9390
|
8
|
+
PyStellarDB-0.13.3.dist-info/WHEEL,sha256=_4XEmVmaBFWtekSGrbfOGNjC2I5lUr0lZSRblBllIFA,109
|
9
|
+
PyStellarDB-0.13.3.dist-info/top_level.txt,sha256=DRk-SeGVCdVAzv2CwFmdu75Yo7DgjUA3Hpu-9l8qPuU,12
|
10
|
+
PyStellarDB-0.13.3.dist-info/RECORD,,
|
pystellardb/_version.py
CHANGED
@@ -8,11 +8,11 @@ import json
|
|
8
8
|
|
9
9
|
version_json = '''
|
10
10
|
{
|
11
|
-
"date": "2024-09-
|
11
|
+
"date": "2024-09-11T10:31:56+0800",
|
12
12
|
"dirty": false,
|
13
13
|
"error": null,
|
14
|
-
"full-revisionid": "
|
15
|
-
"version": "0.13.
|
14
|
+
"full-revisionid": "7b244e0a10d56e002a7a10d9cf7fb5f7049c55b5",
|
15
|
+
"version": "0.13.3"
|
16
16
|
}
|
17
17
|
''' # END VERSION_JSON
|
18
18
|
|
pystellardb/stellar_hive.py
CHANGED
@@ -146,6 +146,7 @@ class StellarConnection(object):
|
|
146
146
|
protocol_version = ttypes.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V6
|
147
147
|
|
148
148
|
self._graph_schema = None
|
149
|
+
self._graph_schema_from_data = None
|
149
150
|
|
150
151
|
try:
|
151
152
|
self._transport.open()
|
@@ -171,6 +172,11 @@ class StellarConnection(object):
|
|
171
172
|
|
172
173
|
self._graph_schema = graph_types.GraphSchema.parseSchemaFromJson(
|
173
174
|
schemaInJson)
|
175
|
+
|
176
|
+
# get schema from data
|
177
|
+
cursor.execute('manipulate graph {} get_schema_from_data'.format(graph_name))
|
178
|
+
self._graph_schema_from_data = cursor.fetchone()[0]
|
179
|
+
self._graph_schema_from_data = json.loads(self._graph_schema_from_data)
|
174
180
|
else:
|
175
181
|
assert response.serverProtocolVersion == protocol_version, \
|
176
182
|
"Unable to handle protocol version {}".format(response.serverProtocolVersion)
|
@@ -219,6 +225,25 @@ class StellarConnection(object):
|
|
219
225
|
def getGraphSchema(self):
|
220
226
|
return self._graph_schema
|
221
227
|
|
228
|
+
def getSchemaFromData(self) -> dict:
|
229
|
+
"""
|
230
|
+
Get schema from graph data.
|
231
|
+
The difference of getGraphSchema() and getSchemaFromData() is the latter one will return start node labels and end node labels of edges.
|
232
|
+
Result format is:
|
233
|
+
{
|
234
|
+
"vertices": [
|
235
|
+
{ "label": "label_a", "fields": ["prop1", "prop2", ...] }
|
236
|
+
],
|
237
|
+
"edges": [
|
238
|
+
"label": "label_b",
|
239
|
+
"fields": ["prop3", "prop4", ...],
|
240
|
+
"src_dst_labels": [
|
241
|
+
{"src": "label_x", "dst": "label_y"},
|
242
|
+
]
|
243
|
+
]
|
244
|
+
}
|
245
|
+
"""
|
246
|
+
return self._graph_schema_from_data
|
222
247
|
|
223
248
|
class StellarCursor(hive.Cursor):
|
224
249
|
"""These objects represent a database cursor, which is used to manage the context of a fetch
|
@@ -1,10 +0,0 @@
|
|
1
|
-
pystellardb/__init__.py,sha256=JOl41NviMN-qDV0Z8ZPmhNIxvgyauGGJHdB4A-8MhqM,93
|
2
|
-
pystellardb/_version.py,sha256=Vt7qCjCMBamE10PReIKwIvI02pMh8mdLJE8ZY2c6T54,498
|
3
|
-
pystellardb/graph_types.py,sha256=j9ZEvnTVRFOttg28rcYvOFzfoOBJcRxXxySKIzEcR-I,13098
|
4
|
-
pystellardb/stellar_hive.py,sha256=Bes99go4oKszP0RiD3OYG3W5g0Sx0cnaXf2yWOosXk0,14010
|
5
|
-
pystellardb/stellar_rdd.py,sha256=TYwsWYeCxfOliGq1kV3ArNXdye55cKWZF7s9M9nDdt4,1324
|
6
|
-
PyStellarDB-0.13.2.dist-info/LICENSE,sha256=1qDFxrywejs7xNBfOr6T-7lOuqDgSNIES77kTYege3w,560
|
7
|
-
PyStellarDB-0.13.2.dist-info/METADATA,sha256=sY89aLWXtPh-MetCwvHzXvwj37_-fqujLLoOqKjMaf8,9390
|
8
|
-
PyStellarDB-0.13.2.dist-info/WHEEL,sha256=_4XEmVmaBFWtekSGrbfOGNjC2I5lUr0lZSRblBllIFA,109
|
9
|
-
PyStellarDB-0.13.2.dist-info/top_level.txt,sha256=DRk-SeGVCdVAzv2CwFmdu75Yo7DgjUA3Hpu-9l8qPuU,12
|
10
|
-
PyStellarDB-0.13.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|