Skip to content

Add runnable count(local) examples to the Count Step docs - #3573

Closed
spmallette wants to merge 1 commit into
apache:3.7-devfrom
spmallette:tp-docs-count-local-examples
Closed

Add runnable count(local) examples to the Count Step docs#3573
spmallette wants to merge 1 commit into
apache:3.7-devfrom
spmallette:tp-docs-count-local-examples

Conversation

@spmallette

Copy link
Copy Markdown
Contributor

The count(local) behavior in the Count Step section of the reference documentation was described only in an IMPORTANT prose callout, with no executable examples. The callout also omitted the Path case: it stated that a count of 1 is returned "for any other object," but CountLocalStep returns the path length for a Path.

This change:

  • Removes the prose-only callout and repurposes its content as explanatory prose that correctly covers all object kinds the step handles: Collection (number of elements), Map (number of entries), Path (number of objects in the path), and any other object (1).
  • Adds a runnable example block against the modern graph so the per-object-kind counts render as live output at build time and are self-verifying:
    • g.V().fold().count(local)6 (Collection)
    • g.V().group().by(label).count(local)2 (Map)
    • g.V(1).out().path().count(local)2, 2, 2 (Path)
    • g.V(1).count(local)1 (any other object)
  • Cross-links the examples to fold(), group(), path(), and the path data structure so a reader can follow the behavior in context.

The reference book builds and the count-step section reads coherently with the rendered live output matching the documented counts.

The count(local) behavior was described only in a prose callout with no
executable examples, and the callout omitted the Path case handled by the
step. Replace it with explanatory prose covering Collection, Map, Path, and
other objects, followed by a runnable example block whose live output shows
the count for each object kind. The examples cross-link to fold(), group(),
path(), and the path data structure so the behavior can be verified in context.

Assisted-by: Kiro:claude-opus-4.8
@codecov-commenter

codecov-commenter commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.51%. Comparing base (4722890) to head (cabf641).
⚠️ Report is 44 commits behind head on 3.7-dev.

Additional details and impacted files
@@              Coverage Diff              @@
##             3.7-dev    #3573      +/-   ##
=============================================
+ Coverage      75.49%   75.51%   +0.01%     
- Complexity     13161    13178      +17     
=============================================
  Files           1092     1093       +1     
  Lines          67208    67254      +46     
  Branches        7391     7397       +6     
=============================================
+ Hits           50742    50789      +47     
- Misses         13837    13840       +3     
+ Partials        2629     2625       -4     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@spmallette

Copy link
Copy Markdown
Contributor Author

Merged with 06e12a8

@spmallette spmallette closed this Jul 28, 2026
@spmallette
spmallette deleted the tp-docs-count-local-examples branch July 28, 2026 14:21
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