Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Apr 29, 2021

Rationale for this change

I have often found myself being confused and searching for this code, so I am hoping to leave some hints to find it. Here is an example where it may have helped: apache/datafusion#223 (though to be honest new_null_array may be newer than the code in datafusion

What changes are included in this PR?

  1. Add some comments in NullArray pointing at new_null_array and move comments to NullArray rather than module
  2. Add doc examples to new_null_array and new_empty_array

Are there any user-facing changes?

Better docs

@alamb alamb added documentation Improvements or additions to documentation arrow Changes to the arrow crate labels Apr 29, 2021
use crate::datatypes::*;

/// An Array where all elements are nulls
///
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By moving the description to the struct, the documentation is now on the doc page I would expect (not the module level). Here is what it looks like now:

Screen Shot 2021-04-29 at 12 54 51 PM

@alamb alamb force-pushed the alamb/better_docs branch from 90dfc74 to cbb9011 Compare April 29, 2021 17:46
Copy link
Contributor

@returnString returnString left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 👍 The note/link to arrow::array::new_null_array is especially handy; I have a poor man's version of this in a few codebases after I looked up NullArray, saw it was an array of the null type, and thought "ok, guess that's not supported".

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2021

Codecov Report

Merging #240 (29a1fb2) into master (4dfbca6) will not change coverage.
The diff coverage is n/a.

❗ Current head 29a1fb2 differs from pull request most recent head fea52de. Consider uploading reports for the commit fea52de to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #240   +/-   ##
=======================================
  Coverage   82.52%   82.52%           
=======================================
  Files         162      162           
  Lines       43672    43672           
=======================================
  Hits        36040    36040           
  Misses       7632     7632           
Impacted Files Coverage Δ
arrow/src/array/array.rs 76.07% <ø> (ø)
arrow/src/array/null.rs 86.66% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4dfbca6...fea52de. Read the comment docs.

Copy link
Contributor

@nevi-me nevi-me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jorgecarleitao jorgecarleitao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. 👍

@alamb alamb force-pushed the alamb/better_docs branch from cbb9011 to fea52de Compare May 3, 2021 13:10
@alamb alamb merged commit a040c15 into apache:master May 3, 2021
@alamb alamb deleted the alamb/better_docs branch June 15, 2021 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants