forked from apache/arrow-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split out arrow-schema (apache#2594)
- Loading branch information
Showing
18 changed files
with
1,727 additions
and
1,597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
[package] | ||
name = "arrow-schema" | ||
version = "22.0.0" | ||
description = "Defines the logical types for arrow arrays" | ||
homepage = "https://github.com/apache/arrow-rs" | ||
repository = "https://github.com/apache/arrow-rs" | ||
authors = ["Apache Arrow <[email protected]>"] | ||
license = "Apache-2.0" | ||
keywords = ["arrow"] | ||
include = [ | ||
"benches/*.rs", | ||
"src/**/*.rs", | ||
"Cargo.toml", | ||
] | ||
edition = "2021" | ||
rust-version = "1.62" | ||
|
||
[lib] | ||
name = "arrow_schema" | ||
path = "src/lib.rs" | ||
bench = false | ||
|
||
[dependencies] | ||
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true } | ||
serde_json = { version = "1.0", default-features = false, features = ["std"], optional = true } | ||
|
||
[package.metadata.docs.rs] | ||
features = ["json"] | ||
|
||
[features] | ||
default = [] | ||
json = ["serde", "serde_json"] | ||
|
||
[dev-dependencies] | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
//! Defines `ArrowSchemaError` for representing failures in arrow schema | ||
use std::error::Error; | ||
|
||
#[derive(Debug)] | ||
pub enum ArrowSchemaError { | ||
Parse(String), | ||
Merge(String), | ||
Field(String), | ||
} | ||
|
||
impl std::fmt::Display for ArrowSchemaError { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
match self { | ||
ArrowSchemaError::Parse(message) => { | ||
write!(f, "Error parsing schema: {}", message) | ||
} | ||
ArrowSchemaError::Merge(message) => { | ||
write!(f, "Error merging schema: {}", message) | ||
} | ||
ArrowSchemaError::Field(message) => { | ||
write!(f, "Error indexing field: {}", message) | ||
} | ||
} | ||
} | ||
} | ||
|
||
impl Error for ArrowSchemaError {} |
Oops, something went wrong.