From 8717ac61ffc8962c18a21e8b991372c5395c7da2 Mon Sep 17 00:00:00 2001 From: "Valeriy V. Vorotyntsev" Date: Sat, 7 Jan 2023 13:58:06 +0200 Subject: [PATCH 1/2] [doc] Fix broken URLs Use proper syntax when [linking to items by name]. Before: https://docs.rs/arrow-array/latest/arrow_array/iterator/%5Bcrate::PrimitiveArray%5D After: https://docs.rs/arrow-array/latest/arrow_array/array/struct.PrimitiveArray.html [linking to items by name]: https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html --- arrow-array/src/iterator.rs | 6 +++--- arrow-array/src/types.rs | 6 +++--- object_store/src/aws/mod.rs | 4 ++-- parquet/src/arrow/arrow_reader/filter.rs | 2 +- parquet/src/arrow/arrow_reader/mod.rs | 6 +++--- parquet/src/arrow/arrow_reader/selection.rs | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arrow-array/src/iterator.rs b/arrow-array/src/iterator.rs index e7c5e8367e2..f12f7dd6df4 100644 --- a/arrow-array/src/iterator.rs +++ b/arrow-array/src/iterator.rs @@ -39,9 +39,9 @@ use crate::array::{ /// there are more efficient ways to iterate over just the non-null indices, this functionality /// is provided by [`compute::try_unary`] /// -/// [`PrimitiveArray`]: [crate::PrimitiveArray] -/// [`compute::unary`]: [arrow::compute::unary] -/// [`compute::try_unary`]: [arrow::compute::try_unary] +/// [`PrimitiveArray`]: crate::PrimitiveArray +/// [`compute::unary`]: arrow::compute::unary +/// [`compute::try_unary`]: arrow::compute::try_unary #[derive(Debug)] pub struct ArrayIter { array: T, diff --git a/arrow-array/src/types.rs b/arrow-array/src/types.rs index 25c047a11d3..c4472c0f33b 100644 --- a/arrow-array/src/types.rs +++ b/arrow-array/src/types.rs @@ -565,9 +565,9 @@ mod decimal { /// Implemented by [`Decimal128Type`] and [`Decimal256Type`] for [`Decimal128Array`] /// and [`Decimal256Array`] respectively /// -/// [`DecimalArray`]: [crate::array::DecimalArray] -/// [`Decimal128Array`]: [crate::array::Decimal128Array] -/// [`Decimal256Array`]: [crate::array::Decimal256Array] +/// [`DecimalArray`]: crate::array::DecimalArray +/// [`Decimal128Array`]: crate::array::Decimal128Array +/// [`Decimal256Array`]: crate::array::Decimal256Array pub trait DecimalType: 'static + Send + Sync + ArrowPrimitiveType + decimal::DecimalTypeSealed { diff --git a/object_store/src/aws/mod.rs b/object_store/src/aws/mod.rs index 4b633d9f5d2..20174692fb5 100644 --- a/object_store/src/aws/mod.rs +++ b/object_store/src/aws/mod.rs @@ -814,8 +814,8 @@ impl AmazonS3Builder { /// /// This option has no effect if not using instance credentials /// - /// [IMDSv2]: [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html] - /// [SSRF attack]: [https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/] + /// [IMDSv2]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html + /// [SSRF attack]: https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/ /// pub fn with_imdsv1_fallback(mut self) -> Self { self.imdsv1_fallback = true; diff --git a/parquet/src/arrow/arrow_reader/filter.rs b/parquet/src/arrow/arrow_reader/filter.rs index cbded9a6f42..ea529b74f61 100644 --- a/parquet/src/arrow/arrow_reader/filter.rs +++ b/parquet/src/arrow/arrow_reader/filter.rs @@ -94,7 +94,7 @@ where /// leaves 99% of the rows, it may be better to not filter the data from parquet and /// apply the filter after the RecordBatch has been fully decoded. /// -/// [`RowSelection`]: [super::selection::RowSelection] +/// [`RowSelection`]: crate::arrow::arrow_reader::RowSelection pub struct RowFilter { /// A list of [`ArrowPredicate`] pub(crate) predicates: Vec>, diff --git a/parquet/src/arrow/arrow_reader/mod.rs b/parquet/src/arrow/arrow_reader/mod.rs index df38e554f9d..312f0140769 100644 --- a/parquet/src/arrow/arrow_reader/mod.rs +++ b/parquet/src/arrow/arrow_reader/mod.rs @@ -50,7 +50,7 @@ pub use selection::{RowSelection, RowSelector}; /// * For a synchronous API - [`ParquetRecordBatchReaderBuilder`] /// * For an asynchronous API - [`ParquetRecordBatchStreamBuilder`] /// -/// [`ParquetRecordBatchStreamBuilder`]: [crate::arrow::async_reader::ParquetRecordBatchStreamBuilder] +/// [`ParquetRecordBatchStreamBuilder`]: crate::arrow::async_reader::ParquetRecordBatchStreamBuilder pub struct ArrowReaderBuilder { pub(crate) input: T, @@ -150,7 +150,7 @@ impl ArrowReaderBuilder { /// An example use case of this would be applying a selection determined by /// evaluating predicates against the [`Index`] /// - /// [`Index`]: [parquet::file::page_index::index::Index] + /// [`Index`]: crate::file::page_index::index::Index pub fn with_row_selection(self, selection: RowSelection) -> Self { Self { selection: Some(selection), @@ -238,7 +238,7 @@ impl ArrowReaderOptions { /// Set this true to enable decoding of the [PageIndex] if present. This can be used /// to push down predicates to the parquet scan, potentially eliminating unnecessary IO /// - /// [PageIndex]: [https://github.com/apache/parquet-format/blob/master/PageIndex.md] + /// [PageIndex]: https://github.com/apache/parquet-format/blob/master/PageIndex.md pub fn with_page_index(self, page_index: bool) -> Self { Self { page_index, ..self } } diff --git a/parquet/src/arrow/arrow_reader/selection.rs b/parquet/src/arrow/arrow_reader/selection.rs index 487e95fcd83..03c7e01e084 100644 --- a/parquet/src/arrow/arrow_reader/selection.rs +++ b/parquet/src/arrow/arrow_reader/selection.rs @@ -83,7 +83,7 @@ impl RowSelector { /// assert_eq!(actual, expected); /// ``` /// -/// [`PageIndex`]: [crate::file::page_index::index::PageIndex] +/// [`PageIndex`]: crate::file::page_index::index::PageIndex #[derive(Debug, Clone, Default, Eq, PartialEq)] pub struct RowSelection { selectors: Vec, From 6fc5ed32150320b3219d9edf231cce27d5c38cd0 Mon Sep 17 00:00:00 2001 From: "Valeriy V. Vorotyntsev" Date: Sat, 7 Jan 2023 17:11:50 +0200 Subject: [PATCH 2/2] [doc] Use proper identifiers arrow-array: - `DecimalArray` is undefined. Use `PrimitiveArray` instead. - `arrow` crate is not among `arrow-array`'s dependencies, so its items cannot be referred to using ['intra-doc link'] syntax. ['intra-doc link']: https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html --- arrow-array/src/iterator.rs | 4 ++-- arrow-array/src/types.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arrow-array/src/iterator.rs b/arrow-array/src/iterator.rs index f12f7dd6df4..ff99233129c 100644 --- a/arrow-array/src/iterator.rs +++ b/arrow-array/src/iterator.rs @@ -40,8 +40,8 @@ use crate::array::{ /// is provided by [`compute::try_unary`] /// /// [`PrimitiveArray`]: crate::PrimitiveArray -/// [`compute::unary`]: arrow::compute::unary -/// [`compute::try_unary`]: arrow::compute::try_unary +/// [`compute::unary`]: https://docs.rs/arrow/latest/arrow/compute/fn.unary.html +/// [`compute::try_unary`]: https://docs.rs/arrow/latest/arrow/compute/fn.try_unary.html #[derive(Debug)] pub struct ArrayIter { array: T, diff --git a/arrow-array/src/types.rs b/arrow-array/src/types.rs index c4472c0f33b..e7d92d2d08f 100644 --- a/arrow-array/src/types.rs +++ b/arrow-array/src/types.rs @@ -559,13 +559,13 @@ mod decimal { impl DecimalTypeSealed for Decimal256Type {} } -/// A trait over the decimal types, used by [`DecimalArray`] to provide a generic +/// A trait over the decimal types, used by [`PrimitiveArray`] to provide a generic /// implementation across the various decimal types /// /// Implemented by [`Decimal128Type`] and [`Decimal256Type`] for [`Decimal128Array`] /// and [`Decimal256Array`] respectively /// -/// [`DecimalArray`]: crate::array::DecimalArray +/// [`PrimitiveArray`]: crate::array::PrimitiveArray /// [`Decimal128Array`]: crate::array::Decimal128Array /// [`Decimal256Array`]: crate::array::Decimal256Array pub trait DecimalType: