Skip to content

feat(go,types): add FileType, Cardinality, AdjListType - #941

Open
ZekiLiu wants to merge 1 commit into
apache:mainfrom
ZekiLiu:828-go-sdk-types-enums
Open

feat(go,types): add FileType, Cardinality, AdjListType#941
ZekiLiu wants to merge 1 commit into
apache:mainfrom
ZekiLiu:828-go-sdk-types-enums

Conversation

@ZekiLiu

@ZekiLiu ZekiLiu commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Reason for this PR

Part of the pure-Go GraphAr SDK (tracking issus #828), following the bootstrap PR #937.
This is the foundational types package: the primitive value enums every higher
layer (info, reader/writer) depends on. Kept separate from DataType (next PR) so
each 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/types with four on-disk value types plus their string
parse/serialize and sentinel errors:

  • FileType — csv / parquet / orc / json
  • Cardinality — single / list / set
  • AdjListType — unordered/ordered × by_source/by_dest, with helpers to convert
    to/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 types package. No breaking changes (new code only).

Enum-style value types with parse/format reciprocity, Equal and the package
error sentinels. Table-driven unit tests.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.78%. Comparing base (54601c9) to head (ab8ea0e).

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              
Flag Coverage Δ
go 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants