Skip to content

Commit df44c33

Browse files
authored
chore: add docs, part of #37 (apache#6453)
* chore: add docs, part of #37 - add pragma `#![warn(missing_docs)]` to the following - `arrow-flight` - `arrow-ipc` - `arrow-integration-test` - `arrow-integration-testing` - `object_store` - also document the caveat with using level 10 GZIP compression in parquet. See apache#6282. * chore: resolve PR comments from apache#6453
1 parent f253f16 commit df44c33

File tree

10 files changed

+72
-17
lines changed

10 files changed

+72
-17
lines changed

src/aws/builder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ static DEFAULT_METADATA_ENDPOINT: &str = "http://169.254.169.254";
4444

4545
/// A specialized `Error` for object store-related errors
4646
#[derive(Debug, Snafu)]
47-
#[allow(missing_docs)]
4847
enum Error {
4948
#[snafu(display("Missing bucket name"))]
5049
MissingBucketName,

src/aws/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ const USER_DEFINED_METADATA_HEADER_PREFIX: &str = "x-amz-meta-";
6565

6666
/// A specialized `Error` for object store-related errors
6767
#[derive(Debug, Snafu)]
68-
#[allow(missing_docs)]
6968
pub(crate) enum Error {
7069
#[snafu(display("Error performing DeleteObjects request: {}", source))]
7170
DeleteObjectsRequest { source: crate::client::retry::Error },

src/aws/resolve.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use snafu::{ensure, OptionExt, ResultExt, Snafu};
2121

2222
/// A specialized `Error` for object store-related errors
2323
#[derive(Debug, Snafu)]
24-
#[allow(missing_docs)]
2524
enum Error {
2625
#[snafu(display("Bucket '{}' not found", bucket))]
2726
BucketNotFound { bucket: String },

src/azure/builder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ const MSI_ENDPOINT_ENV_KEY: &str = "IDENTITY_ENDPOINT";
4646

4747
/// A specialized `Error` for Azure builder-related errors
4848
#[derive(Debug, Snafu)]
49-
#[allow(missing_docs)]
5049
enum Error {
5150
#[snafu(display("Unable parse source url. Url: {}, Error: {}", url, source))]
5251
UnableToParseUrl {

src/azure/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ static TAGS_HEADER: HeaderName = HeaderName::from_static("x-ms-tags");
6060

6161
/// A specialized `Error` for object store-related errors
6262
#[derive(Debug, Snafu)]
63-
#[allow(missing_docs)]
6463
pub(crate) enum Error {
6564
#[snafu(display("Error performing get request {}: {}", path, source))]
6665
GetRequest {

src/client/get.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ impl ContentRange {
9696

9797
/// A specialized `Error` for get-related errors
9898
#[derive(Debug, Snafu)]
99-
#[allow(missing_docs)]
10099
enum GetResultError {
101100
#[snafu(context(false))]
102101
Header {

src/lib.rs

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,78 +1224,116 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
12241224

12251225
/// A specialized `Error` for object store-related errors
12261226
#[derive(Debug, Snafu)]
1227-
#[allow(missing_docs)]
12281227
#[non_exhaustive]
12291228
pub enum Error {
1229+
/// A fallback error type when no variant matches
12301230
#[snafu(display("Generic {} error: {}", store, source))]
12311231
Generic {
1232+
/// The store this error originated from
12321233
store: &'static str,
1234+
/// The wrapped error
12331235
source: Box<dyn std::error::Error + Send + Sync + 'static>,
12341236
},
12351237

1238+
/// Error when the object is not found at given location
12361239
#[snafu(display("Object at location {} not found: {}", path, source))]
12371240
NotFound {
1241+
/// The path to file
12381242
path: String,
1243+
/// The wrapped error
12391244
source: Box<dyn std::error::Error + Send + Sync + 'static>,
12401245
},
12411246

1247+
/// Error for invalid path
12421248
#[snafu(
12431249
display("Encountered object with invalid path: {}", source),
12441250
context(false)
12451251
)]
1246-
InvalidPath { source: path::Error },
1252+
InvalidPath {
1253+
/// The wrapped error
1254+
source: path::Error,
1255+
},
12471256

1257+
/// Error when `tokio::spawn` failed
12481258
#[snafu(display("Error joining spawned task: {}", source), context(false))]
1249-
JoinError { source: tokio::task::JoinError },
1259+
JoinError {
1260+
/// The wrapped error
1261+
source: tokio::task::JoinError,
1262+
},
12501263

1264+
/// Error when the attempted operation is not supported
12511265
#[snafu(display("Operation not supported: {}", source))]
12521266
NotSupported {
1267+
/// The wrapped error
12531268
source: Box<dyn std::error::Error + Send + Sync + 'static>,
12541269
},
12551270

1271+
/// Error when the object already exists
12561272
#[snafu(display("Object at location {} already exists: {}", path, source))]
12571273
AlreadyExists {
1274+
/// The path to the
12581275
path: String,
1276+
/// The wrapped error
12591277
source: Box<dyn std::error::Error + Send + Sync + 'static>,
12601278
},
12611279

1280+
/// Error when the required conditions failed for the operation
12621281
#[snafu(display("Request precondition failure for path {}: {}", path, source))]
12631282
Precondition {
1283+
/// The path to the file
12641284
path: String,
1285+
/// The wrapped error
12651286
source: Box<dyn std::error::Error + Send + Sync + 'static>,
12661287
},
12671288

1289+
/// Error when the object at the location isn't modified
12681290
#[snafu(display("Object at location {} not modified: {}", path, source))]
12691291
NotModified {
1292+
/// The path to the file
12701293
path: String,
1294+
/// The wrapped error
12711295
source: Box<dyn std::error::Error + Send + Sync + 'static>,
12721296
},
12731297

1298+
/// Error when an operation is not implemented
12741299
#[snafu(display("Operation not yet implemented."))]
12751300
NotImplemented,
12761301

1302+
/// Error when the used credentials don't have enough permission
1303+
/// to perform the requested operation
12771304
#[snafu(display(
12781305
"The operation lacked the necessary privileges to complete for path {}: {}",
12791306
path,
12801307
source
12811308
))]
12821309
PermissionDenied {
1310+
/// The path to the file
12831311
path: String,
1312+
/// The wrapped error
12841313
source: Box<dyn std::error::Error + Send + Sync + 'static>,
12851314
},
12861315

1316+
/// Error when the used credentials lack valid authentication
12871317
#[snafu(display(
12881318
"The operation lacked valid authentication credentials for path {}: {}",
12891319
path,
12901320
source
12911321
))]
12921322
Unauthenticated {
1323+
/// The path to the file
12931324
path: String,
1325+
/// The wrapped error
12941326
source: Box<dyn std::error::Error + Send + Sync + 'static>,
12951327
},
12961328

1329+
/// Error when a configuration key is invalid for the store used
12971330
#[snafu(display("Configuration key: '{}' is not valid for store '{}'.", key, store))]
1298-
UnknownConfigurationKey { store: &'static str, key: String },
1331+
UnknownConfigurationKey {
1332+
/// The object store used
1333+
store: &'static str,
1334+
/// The configuration key used
1335+
key: String,
1336+
},
12991337
}
13001338

13011339
impl From<Error> for std::io::Error {

src/local.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use crate::{
4444

4545
/// A specialized `Error` for filesystem object store-related errors
4646
#[derive(Debug, Snafu)]
47-
#[allow(missing_docs)]
4847
pub(crate) enum Error {
4948
#[snafu(display("File size for {} did not fit in a usize: {}", path, source))]
5049
FileSizeOverflowedUsize {

src/memory.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use crate::{GetOptions, PutPayload};
3838

3939
/// A specialized `Error` for in-memory object store-related errors
4040
#[derive(Debug, Snafu)]
41-
#[allow(missing_docs)]
4241
enum Error {
4342
#[snafu(display("No data in memory found. Location: {path}"))]
4443
NoDataInMemory { path: String },

src/path/mod.rs

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,57 @@ pub use parts::{InvalidPart, PathPart};
3636

3737
/// Error returned by [`Path::parse`]
3838
#[derive(Debug, Snafu)]
39-
#[allow(missing_docs)]
4039
#[non_exhaustive]
4140
pub enum Error {
41+
/// Error when there's an empty segment between two slashes `/` in the path
4242
#[snafu(display("Path \"{}\" contained empty path segment", path))]
43-
EmptySegment { path: String },
43+
EmptySegment {
44+
/// The source path
45+
path: String,
46+
},
4447

48+
/// Error when an invalid segment is encountered in the given path
4549
#[snafu(display("Error parsing Path \"{}\": {}", path, source))]
46-
BadSegment { path: String, source: InvalidPart },
50+
BadSegment {
51+
/// The source path
52+
path: String,
53+
/// The part containing the error
54+
source: InvalidPart,
55+
},
4756

57+
/// Error when path cannot be canonicalized
4858
#[snafu(display("Failed to canonicalize path \"{}\": {}", path.display(), source))]
4959
Canonicalize {
60+
/// The source path
5061
path: std::path::PathBuf,
62+
/// The underlying error
5163
source: std::io::Error,
5264
},
5365

66+
/// Error when the path is not a valid URL
5467
#[snafu(display("Unable to convert path \"{}\" to URL", path.display()))]
55-
InvalidPath { path: std::path::PathBuf },
68+
InvalidPath {
69+
/// The source path
70+
path: std::path::PathBuf,
71+
},
5672

73+
/// Error when a path contains non-unicode characters
5774
#[snafu(display("Path \"{}\" contained non-unicode characters: {}", path, source))]
5875
NonUnicode {
76+
/// The source path
5977
path: String,
78+
/// The underlying `UTF8Error`
6079
source: std::str::Utf8Error,
6180
},
6281

82+
/// Error when the a path doesn't start with given prefix
6383
#[snafu(display("Path {} does not start with prefix {}", path, prefix))]
64-
PrefixMismatch { path: String, prefix: String },
84+
PrefixMismatch {
85+
/// The source path
86+
path: String,
87+
/// The mismatched prefix
88+
prefix: String,
89+
},
6590
}
6691

6792
/// A parsed path representation that can be safely written to object storage

0 commit comments

Comments
 (0)