Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): remove crates-io-wait.py script #68

Merged
merged 3 commits into from
Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Rust
on:
pull_request:
push:
branches: [ main ]
tags: [ 'v*.*.*' ]
branches: [main]
tags: ["v*.*.*"]

jobs:
check:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ check, test ]
needs: [check, test]
environment: VALIDATOR_RELEASE
steps:
- uses: actions/checkout@v2
Expand All @@ -129,9 +129,6 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --allow-dirty
- name: Wait for substrait-validator-derive to appear in the index
continue-on-error: true
run: python3 ci/crates-io-wait.py substrait-validator-derive `cat ci/version` 1800
- name: Publish substrait-validator
working-directory: rs
env:
Expand Down
72 changes: 0 additions & 72 deletions ci/crates-io-wait.py

This file was deleted.

4 changes: 4 additions & 0 deletions rs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ fn main() -> Result<()> {
// Compile the protobuf files using prost.
let mut config = prost_build::Config::new();
config.type_attribute(".", "#[derive(::substrait_validator_derive::ProtoMeta)]");
config.disable_comments([
"substrait.AggregateRel.Measure.filter",
"substrait.Type.Parameter.data_type",
]);
config.compile_protos(&proto_files, &[&proto_path.display().to_string()])?;

// Inform cargo that changes to the .proto files require a rerun.
Expand Down
12 changes: 6 additions & 6 deletions rs/src/input/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ pub struct Config {
/// pre-downloaded files.
pub uri_overrides: Vec<(glob::Pattern, Option<String>)>,

/// Optional callback function for resolving URIs. If specified, all
/// URIs (after processing yaml_uri_overrides) are resolved using this
/// function. The function takes the URI as its argument, and should either
/// return the download contents as a Vec<u8> or return a String-based
/// error. If no downloader is specified, only file:// URLs with an
/// absolute path are supported.
/// Optional callback function for resolving URIs. If specified, all URIs
/// (after processing yaml_uri_overrides) are resolved using this function.
/// The function takes the URI as its argument, and should either return the
/// download contents as a `Vec<u8>` or return a String-based error. If no
/// downloader is specified, only file:// URLs with an absolute path are
/// supported.
pub uri_resolver: Option<UriResolver>,

/// Optional URI resolution depth. If specified, dependencies are only
Expand Down
2 changes: 1 addition & 1 deletion rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! 1) Build a [`Config`] structure to configure the validator. You can also
//! just use [`std::default::Default`] if you don't need to configure
//! anything, but you might want to at least call
//! [`Config::add_curl_uri_resolver()`] (if you're using the `curl`
//! `Config::add_curl_uri_resolver()` (if you're using the `curl`
//! feature).
//! 2) Parse the incoming `substrait.Plan` message using [`parse()`]. This
//! creates a [ParseResult], containing a [tree](output::tree) structure
Expand Down
2 changes: 1 addition & 1 deletion rs/src/output/type_system/data/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl Definition {
)
}

/// Returns Some(Vec<T>)) when this is a STRUCT or NSTRUCT type, where the
/// Returns `Some(Vec<T>))` when this is a STRUCT or NSTRUCT type, where the
/// vector contains the field types. Returns None otherwise.
pub fn unwrap_struct(&self) -> Option<Vec<Arc<Definition>>> {
if self.is_struct() {
Expand Down
8 changes: 1 addition & 7 deletions rs/src/parse/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,7 @@ impl<'a> Context<'a> {
.unwrap_or(&(diagnostic::Level::Info, diagnostic::Level::Error));

// Adjust the level.
let adjusted_level = if diag.level < *min {
*min
} else if diag.level > *max {
*max
} else {
diag.level
};
let adjusted_level = diag.level.clamp(*min, *max);
let adjusted = diag.adjust_level(adjusted_level);

// Actually push the data item.
Expand Down
2 changes: 1 addition & 1 deletion rs/src/parse/expressions/literals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl Describe for Literal {
_ => write!(f, "{i}"),
},
LiteralValue::Float(v) => {
let max = std::cmp::min(std::cmp::max(3, limit.chars()), 10);
let max = limit.chars().clamp(3, 10);
write!(f, "{:3.1$}", float_pretty_print::PrettyPrintFloat(*v), max)
}
LiteralValue::Data16(d) => match self.data_type.class() {
Expand Down