You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "spmallette (via GitHub)" <gi...@apache.org> on 2026/08/13 15:38:54 UTC
[PR] Expand Map Step reference documentation with examples and contract [tinkerpop]
spmallette opened a new pull request, #3622:
URL: https://github.com/apache/tinkerpop/pull/3622
## What
The `map()` step's entry in the reference documentation (`docs/src/reference/the-traversal.asciidoc`, Map Step section) was a single vague sentence pointing at General Steps, with one javadoc link and no runnable example. This expands it into a proper reference section.
## Changes
- Adds runnable `[gremlin-groovy,modern]` examples, including a `map(out())` vs `flatMap(out())` contrast so the cardinality difference is visible in the rendered output.
- States `map()`'s one-to-one contract explicitly: it emits exactly one object per incoming traverser by taking only the **first** result of its child traversal; additional child results are ignored, and a traverser whose child traversal produces **no** result is silently **dropped**.
- Adds a note contrasting `map()` and `flatMap()` by cardinality.
- Adds a short framing note so a newcomer understands when `map()` is actually warranted — pointing out that `map(values('name'))` is contrived (`g.V().values('name')` does the same thing) while `map(out('created').count())` is a legitimate use because it derives a per-traverser value that needs the child traversal.
The change is scoped to the Map Step section only.
## Testing
The examples are live `[gremlin-groovy,modern]` blocks executed against the "modern" graph at doc-build time. The rendered output confirms the documented behavior: `map(out())` emits a single vertex while `flatMap(out())` emits all three, and `map(out('created'))` emits only the vertices that created something (the non-creating vertices are dropped). Built locally with `bin/process-docs.sh` and reviewed the rendered `reference/index.html#map-step`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Expand Map Step reference documentation with examples and contract [tinkerpop]
Posted by "spmallette (via GitHub)" <gi...@apache.org>.
spmallette merged PR #3622:
URL: https://github.com/apache/tinkerpop/pull/3622
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Expand Map Step reference documentation with examples and contract [tinkerpop]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3622:
URL: https://github.com/apache/tinkerpop/pull/3622#issuecomment-5282942475
## [Codecov](https://app.codecov.io/gh/apache/tinkerpop/pull/3622?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 80.05%. Comparing base ([`a28cd1f`](https://app.codecov.io/gh/apache/tinkerpop/commit/a28cd1f2f1f10c140030a56de44c5c6c045af5f0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a41478f`](https://app.codecov.io/gh/apache/tinkerpop/commit/a41478fdc43118edcd29956803ffe2521964eee0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 501 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #3622 +/- ##
============================================
+ Coverage 76.35% 80.05% +3.69%
============================================
Files 1012 32 -980
Lines 60341 6913 -53428
Branches 7075 0 -7075
============================================
- Hits 46076 5534 -40542
+ Misses 11548 1053 -10495
+ Partials 2717 326 -2391
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/tinkerpop/pull/3622?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org