Skip to content

Commit

Permalink
feat: Add get_prop_names methods for scan results (#297)
Browse files Browse the repository at this point in the history
* feat: Add get_prop_names methods for scan results

* tests: Add more Python versions

* fix Python test version 3.10

* Update dev.txt

* Drop Python 3.6 3.7 3.8
  • Loading branch information
haoxins authored Jan 8, 2024
1 parent 469e25f commit fce0b09
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.9, '3.10', 3.11, 3.12]

steps:
- name: Maximize runner space
Expand All @@ -24,7 +24,7 @@ jobs:
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'

- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down
14 changes: 14 additions & 0 deletions nebula3/sclient/BaseResult.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ def as_node(self):

return Node(vertex).set_decode_type(self._decode_type)

def get_prop_names(self):
"""get all prop names from the vertex data
:return: list<string>
"""
return self._col_names[self.PROP_START_INDEX :]

def get_prop_values(self):
"""get all prop values from the vertex data
Expand Down Expand Up @@ -197,6 +204,13 @@ def as_relationship(self):

return Relationship(edge).set_decode_type(self._decode_type)

def get_prop_names(self):
"""get all prop names from the edge data
:return: list<string>
"""
return self._col_names[self.PROP_START_INDEX :]

def get_prop_values(self):
"""get all prop values from the edge data
Expand Down
19 changes: 5 additions & 14 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements/dev.in
#

attrs==23.1.0
# via pytest
build==1.0.3
# via pip-tools
click==8.1.7
# via pip-tools
coverage[toml]==7.2.7
# via pytest-cov
importlib-metadata==6.7.0
# via build
# via
# coverage
# pytest-cov
iniconfig==2.0.0
# via pytest
numpy==1.21.6
numpy==1.26.3
# via pandas
packaging==23.2
# via
Expand Down Expand Up @@ -49,18 +48,10 @@ six==1.16.0
# via python-dateutil
toml==0.10.2
# via pytest
tomli==2.0.1
# via
# build
# coverage
# pip-tools
# pyproject-hooks
wcwidth==0.2.8
# via prettytable
wheel==0.41.2
# via pip-tools
zipp==3.15.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
'pytz >= 2021.1',
],
packages=find_packages(),
platforms=['3.6, 3.7'],
platforms=['3.9, 3.10, 3.11, 3.12'],
package_dir={'nebula3': 'nebula3'},
)

0 comments on commit fce0b09

Please sign in to comment.