-
Notifications
You must be signed in to change notification settings - Fork 80
feat(python): refactor python module(from cli module) #799
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
Conversation
|
cc @adsharma |
|
@yangxk1 Nice work! Does it contain arrow-pyarrow bindings to cpp module? It should be possible to do in a zer-copy way in my understanding... Convert to arrow-type would be nice to expose too... |
|
@SemyonSinchenko , This PR only involves schema yaml. At the same time I am working on another PR to build the After completing these two tasks, I will work on c arrow and pyarrow, which will allow users to operate the data set more precisely. |
|
I think it will be weird to call |
An error occurred when I used |
renamed client->cli |
|
Looks great! This is what I had in mind before I got busy with LadybugDB. One high level thing to consider: instead of exposing Example: |
Thanks for your suggestion, I will study ctypes carefully. |
|
I'm sure there are implementation details such as C++ enums. Was thinking about it from end user perspective: There may be type checkers that understand integer overflow and other concepts to find bugs that'd be possible when you use those types vs graphar specific C++ enums. A thin translation layer between C++ -> python API could map the types, so the knowledge of these python types doesn't carry over to the rest of the code base. |
|
Looks great, I'll consider using ctypes to optimize the code! |
Reason for this PR
close #798
This PR refactors and enhances the Python module of Apache GraphAr (incubating), transforming it from a CLI-only tool into a full-featured Python SDK with both programmatic APIs and a command-line interface.
The original Python implementation was tightly coupled as a CLI utility (graphar_cli). To support broader use cases this PR restructures the module into a proper API SDK while preserving and improving CLI functionality.
What changes are included in this PR?
Module restructuring: The
cli/directory is renamed topython/, and internal code is reorganized into logical packages:graphar/: Core Python API (e.g., GraphInfo, VertexInfo, EdgeInfo)client/: CLI implementation (graphar command)graphar/importer/: Data import utilitiesNew public APIs: Exposes C++ GraphAr types (e.g.,
Type,FileType,AdjListType) and metadata classes via pybind11 bindings, enabling programmatic access to GraphAr metadata.Improved CLI:
--versionflagTesting:
GraphInfo,vertex/edgemetadata, andpropertyGroupsAre these changes tested?
yes, add pytest methods
Are there any user-facing changes?
YES
Users can now import graphar and use APIs to read GraphAr metadata