alamb commented on code in PR #7747:
URL: https://github.com/apache/arrow-rs/pull/7747#discussion_r2161787638
##########
parquet-variant/tests/variant_interop.rs:
##########
@@ -18,19 +18,63 @@
//! End-to-end check: (almost) every sample from apache/parquet-testing/variant
//! can be parsed into our `Variant`.
-// NOTE: We keep this file separate rather than a test mod inside variant.rs
because it should be
-// moved to the test folder later
-use std::fs;
use std::path::{Path, PathBuf};
+use std::{env, fs};
use chrono::NaiveDate;
use parquet_variant::{ShortString, Variant, VariantBuilder};
+/// Returns a directory path for the parquet variant test data.
+///
+/// The data lives in the `parquet-testing` git repository:
+/// <https://github.com/apache/parquet-testing>
+///
+/// Normally this is checked out as a git submodule in the root of the
`arrow-rs` repository,
+/// so the relative path is
+/// * `CARGO_MANIFEST_DIR/../parquet-testing/variant`.
+///
+/// However, the user can override this by setting the environment variable
`PARQUET_TEST_DATA`
+/// to point to a different directory (as is done by the
`verify-release-candidate.sh` script).
+///
+/// In this case, the environment variable `PARQUET_TEST_DATA` is expected to
point to a directory
+/// `parquet-testing/data`, so the relative path to the `variant` subdirectory
is
+/// * `PARQUET_TEST_DATA/../variant`.
fn cases_dir() -> PathBuf {
- Path::new(env!("CARGO_MANIFEST_DIR"))
+ // which we expect to point at "../parquet-testing/data"
+ let env_name = "PARQUET_TEST_DATA";
Review Comment:
This is largely copied from test_util.rs in arrow
https://github.com/apache/arrow-rs/blob/6d01dd9faf99683ecac5e58f9a1a281ac025efa8/arrow/src/util/test_util.rs#L85-L105
However I didn't want to add a dependency on arrow for this crate (even for
development)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]