Skip to content

Commit

Permalink
remove outdated example (#2824)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Mar 3, 2022
1 parent 82f1cb2 commit 0265a86
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 360 deletions.
13 changes: 0 additions & 13 deletions examples/aggregate_multiple_files_in_chunks/Cargo.toml

This file was deleted.

328 changes: 0 additions & 328 deletions examples/aggregate_multiple_files_in_chunks/src/main.rs

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion nodejs-polars/__tests__/io.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from "path";
import {Stream} from "stream";
import fs from "fs";
// eslint-disable-next-line no-undef
const csvpath = path.resolve(__dirname, "../../examples/aggregate_multiple_files_in_chunks/datasets/foods1.csv");
const csvpath = path.resolve(__dirname, "../../examples/datasets/foods1.csv");
// eslint-disable-next-line no-undef
const parquetpath = path.resolve(__dirname, "./examples/foods.parquet");
// eslint-disable-next-line no-undef
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-io/src/csv_core/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ mod test {

#[test]
fn test_get_file_chunks() {
let path = "../../examples/aggregate_multiple_files_in_chunks/datasets/foods1.csv";
let path = "../../examples/datasets/foods1.csv";
let s = std::fs::read_to_string(path).unwrap();
let bytes = s.as_bytes();
// can be within -1 / +1 bounds.
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-io/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use polars_core::prelude::*;

#[test]
fn test_filter() -> Result<()> {
let path = "../../examples/aggregate_multiple_files_in_chunks/datasets/foods1.csv";
let path = "../../examples/datasets/foods1.csv";
let df = CsvReader::from_path(path)?.finish()?;

let out = df.filter(&df.column("fats_g")?.gt(4))?;
Expand Down
8 changes: 4 additions & 4 deletions polars/polars-lazy/src/tests/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fn test_parquet_globbing() -> Result<()> {
// for side effects
init_files();
let _guard = SINGLE_LOCK.lock().unwrap();
let glob = "../../examples/aggregate_multiple_files_in_chunks/datasets/*.parquet";
let glob = "../../examples/datasets/*.parquet";
let df = LazyFrame::scan_parquet(
glob.into(),
ScanArgsParquet {
Expand All @@ -172,7 +172,7 @@ fn test_parquet_globbing() -> Result<()> {
fn test_ipc_globbing() -> Result<()> {
// for side effects
init_files();
let glob = "../../examples/aggregate_multiple_files_in_chunks/datasets/*.ipc";
let glob = "../../examples/datasets/*.ipc";
let df = LazyFrame::scan_ipc(
glob.into(),
ScanArgsIpc {
Expand Down Expand Up @@ -204,7 +204,7 @@ fn slice_at_union(lp_arena: &Arena<ALogicalPlan>, lp: Node) -> bool {
#[test]
#[cfg(not(target_os = "windows"))]
fn test_csv_globbing() -> Result<()> {
let glob = "../../examples/aggregate_multiple_files_in_chunks/datasets/*.csv";
let glob = "../../examples/datasets/*.csv";
let full_df = LazyCsvReader::new(glob.into()).finish()?.collect()?;

// all 5 files * 27 rows
Expand All @@ -213,7 +213,7 @@ fn test_csv_globbing() -> Result<()> {
assert_eq!(cal.get(0), AnyValue::Int64(45));
assert_eq!(cal.get(53), AnyValue::Int64(194));

let glob = "../../examples/aggregate_multiple_files_in_chunks/datasets/*.csv";
let glob = "../../examples/datasets/*.csv";
let lf = LazyCsvReader::new(glob.into()).finish()?.slice(0, 100);

let df = lf.clone().collect()?;
Expand Down
17 changes: 8 additions & 9 deletions polars/polars-lazy/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ use polars_core::export::chrono::{NaiveDate, NaiveDateTime, NaiveTime};
use polars_core::export::lazy_static::lazy_static;
use std::iter::FromIterator;

static GLOB_PARQUET: &str = "../../examples/aggregate_multiple_files_in_chunks/datasets/*.parquet";
static GLOB_CSV: &str = "../../examples/aggregate_multiple_files_in_chunks/datasets/*.csv";
static GLOB_IPC: &str = "../../examples/aggregate_multiple_files_in_chunks/datasets/*.ipc";
static FOODS_CSV: &str = "../../examples/aggregate_multiple_files_in_chunks/datasets/foods1.csv";
static FOODS_IPC: &str = "../../examples/aggregate_multiple_files_in_chunks/datasets/foods1.ipc";
static FOODS_PARQUET: &str =
"../../examples/aggregate_multiple_files_in_chunks/datasets/foods1.parquet";
static GLOB_PARQUET: &str = "../../examples/datasets/*.parquet";
static GLOB_CSV: &str = "../../examples/datasets/*.csv";
static GLOB_IPC: &str = "../../examples/datasets/*.ipc";
static FOODS_CSV: &str = "../../examples/datasets/foods1.csv";
static FOODS_IPC: &str = "../../examples/datasets/foods1.ipc";
static FOODS_PARQUET: &str = "../../examples/datasets/foods1.parquet";

lazy_static! {
// needed prevent race conditions during test execution
Expand All @@ -60,8 +59,8 @@ fn scan_foods_ipc() -> LazyFrame {

fn init_files() {
for path in &[
"../../examples/aggregate_multiple_files_in_chunks/datasets/foods1.csv",
"../../examples/aggregate_multiple_files_in_chunks/datasets/foods2.csv",
"../../examples/datasets/foods1.csv",
"../../examples/datasets/foods2.csv",
] {
let out_path1 = path.replace(".csv", ".parquet");
let out_path2 = path.replace(".csv", ".ipc");
Expand Down
2 changes: 1 addition & 1 deletion polars/tests/it/io/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::*;
use polars::io::RowCount;
use std::io::Cursor;

const FOODS_CSV: &str = "../examples/aggregate_multiple_files_in_chunks/datasets/foods1.csv";
const FOODS_CSV: &str = "../examples/datasets/foods1.csv";

#[test]
fn write_csv() {
Expand Down
2 changes: 1 addition & 1 deletion polars/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ mod joins;
mod lazy;
mod schema;

pub static FOODS_CSV: &str = "../examples/aggregate_multiple_files_in_chunks/datasets/foods1.csv";
pub static FOODS_CSV: &str = "../examples/datasets/foods1.csv";
1 change: 0 additions & 1 deletion py-polars/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"..",
"..",
"examples",
"aggregate_multiple_files_in_chunks",
"datasets",
)
)
Expand Down

0 comments on commit 0265a86

Please sign in to comment.