Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix-explode-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
nwagner84 committed May 29, 2024
2 parents 3bd81a8 + 3efe646 commit b9973be
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 34 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ jobs:
matrix:
target:
- { os: ubuntu-latest, toolchain: stable, triple: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, toolchain: 1.74.1, triple: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, toolchain: 1.76, triple: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, toolchain: beta, triple: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, toolchain: nightly, triple: x86_64-unknown-linux-gnu }
- { os: macos-latest, toolchain: stable, triple: x86_64-apple-darwin }
- { os: macos-latest, toolchain: 1.74.1, triple: x86_64-apple-darwin }
- { os: macos-latest, toolchain: 1.76, triple: x86_64-apple-darwin }
- { os: windows-latest, toolchain: stable, triple: x86_64-pc-windows-gnu }
- { os: windows-latest, toolchain: 1.74.1, triple: x86_64-pc-windows-gnu }
- { os: windows-latest, toolchain: 1.76, triple: x86_64-pc-windows-gnu }
- { os: windows-latest, toolchain: stable, triple: i686-pc-windows-msvc }
- { os: windows-latest, toolchain: 1.74.1, triple: i686-pc-windows-msvc }
- { os: windows-latest, toolchain: 1.76, triple: i686-pc-windows-msvc }
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -183,7 +183,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/install@cargo-outdated
- uses: Swatinem/rust-cache@v2
- run: cargo outdated --exit-code 1
- run: cargo update
- run: cargo outdated --workspace --exit-code 1

miri:
name: miri
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/install@cargo-outdated
- uses: Swatinem/rust-cache@v2
- run: cargo outdated --exit-code 1
- run: cargo update
- run: cargo outdated --workspace --exit-code 1
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ license = "EUPL-1.2"
readme = "./README.md"
keywords = ["PICA+", "code4lib"]
edition = "2021"
rust-version = "1.74.1"
rust-version = "1.76"

[workspace.dependencies]
pica-matcher = { version = "0.24", path = "./crates/pica-matcher" }
Expand All @@ -31,11 +31,11 @@ pica-utils = { version = "0.24", path = "./crates/pica-utils" }
anyhow = "1.0"
bstr = "1.9"
chrono = { version = "0.4", default-features = false }
clap = "4.4"
clap_complete = "4.4"
clap = "4.5"
clap_complete = "4.5"
csv = "1.3"
flate2 = "1.0"
polars = { version = "0.38", features = ["ipc", "decompress", "performant"] }
polars = { version = "0.40", features = ["ipc", "decompress", "performant"] }
quickcheck = "1.0"
rand = "0.8"
regex = "1.10"
Expand Down
3 changes: 0 additions & 3 deletions crates/pica-toolkit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ toml = { workspace = true }
unicode-normalization = { version = "0.1" }

[dev-dependencies]
assert_cmd = "2.0"
predicates = "3.0"
quickcheck = "1.0"
quickcheck_macros = "1.0"
tempfile = "3.8"
trycmd = "0.15"

[[bin]]
Expand Down
43 changes: 22 additions & 21 deletions crates/pica-toolkit/src/filter_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,35 +93,36 @@ impl FilterList {
) -> Result<DataFrame, FilterListError> {
let extension = path.extension().and_then(OsStr::to_str);
let path_str = path.to_str().unwrap_or_default();
let path = path.to_owned();

let options = CsvReadOptions::default()
.with_has_header(true)
.with_infer_schema_length(Some(0));

match extension {
Some("ipc" | "arrow" | "feather") => {
Ok(IpcReader::new(File::open(path)?)
.memory_mapped(false)
.memory_mapped(None)
.finish()?)
}
Some("csv") => Ok(CsvReader::from_path(path)?
.infer_schema(Some(0))
.has_header(true)
Some("csv") => Ok(options
.try_into_reader_with_file_path(Some(path))?
.finish()?),
Some("gz") if path_str.ends_with(".csv.gz") => {
Ok(CsvReader::from_path(path)?
.infer_schema(Some(0))
.has_header(true)
.finish()?)
}
Some("tsv") => Ok(CsvReader::from_path(path)?
.with_separator(b'\t')
.has_header(true)
.infer_schema(Some(0))
Some("gz") if path_str.ends_with(".csv.gz") => Ok(options
.try_into_reader_with_file_path(Some(path))?
.finish()?),
Some("tsv") => Ok(options
.with_parse_options(
CsvParseOptions::default().with_separator(b'\t'),
)
.try_into_reader_with_file_path(Some(path))?
.finish()?),
Some("gz") if path_str.ends_with(".tsv.gz") => Ok(options
.with_parse_options(
CsvParseOptions::default().with_separator(b'\t'),
)
.try_into_reader_with_file_path(Some(path))?
.finish()?),
Some("gz") if path_str.ends_with(".tsv.gz") => {
Ok(CsvReader::from_path(path)?
.with_separator(b'\t')
.infer_schema(Some(0))
.has_header(true)
.finish()?)
}
_ => {
Err(FilterListError::InvalidFileFormat(path_str.into()))
}
Expand Down

0 comments on commit b9973be

Please sign in to comment.