feat(go,types): add FileType, Cardinality, AdjListType - #941
Open
ZekiLiu wants to merge 1 commit into
Open
Conversation
Enum-style value types with parse/format reciprocity, Equal and the package error sentinels. Table-driven unit tests.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #941 +/- ##
============================================
+ Coverage 77.40% 77.78% +0.37%
Complexity 615 615
============================================
Files 84 88 +4
Lines 8957 9109 +152
Branches 1069 1069
============================================
+ Hits 6933 7085 +152
Misses 1784 1784
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for this PR
Part of the pure-Go GraphAr SDK (tracking issus #828), following the bootstrap PR #937.
This is the foundational
typespackage: the primitive value enums every higherlayer (info, reader/writer) depends on. Kept separate from
DataType(next PR) soeach PR stays a single, reviewable module. The diff is a bit over the usual size,
but about half is table-driven tests and the four enums are one cohesive,
dependency-free unit; splitting them further would fragment the value layer.
What changes are included in this PR?
New package
go/graphar/typeswith four on-disk value types plus their stringparse/serialize and sentinel errors:
FileType— csv / parquet / orc / jsonCardinality— single / list / setAdjListType— unordered/ordered × by_source/by_dest, with helpers to convertto/from the legacy
(ordered, aligned_by)form (src/dst)Enum members and on-disk spellings match the C++ and Java SDKs (verified
member-by-member); Rust and Python are FFI/bindings over C++. No Arrow or
third-party dependency.
Are these changes tested?
Yes. Table-driven unit tests cover round-trips, error paths, defensive copying,
and the lenient/strict version-string cases.
Are there any user-facing changes?
Yes — this adds the public
typespackage. No breaking changes (new code only).