You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/12/22 05:41:32 UTC

[GitHub] [arrow] jorgecarleitao commented on a change in pull request #8967: ARROW-10967: [Rust] Add mod arrow::util::test_data_dir

jorgecarleitao commented on a change in pull request #8967:
URL: https://github.com/apache/arrow/pull/8967#discussion_r547078506



##########
File path: rust/arrow/src/util/test_data_dir.rs
##########
@@ -0,0 +1,258 @@
+// 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.
+
+//! Utils for getting "external" test data dirs for arrow and parquet, to make testing,
+//! benchmark and example easier.
+
+use std::{env, error::Error, path::PathBuf, process::Command};
+
+const ARROW_ENV: &str = "ARROW_TEST_DATA";
+const ARROW_SUBMODULE: &str = "testing";
+const ARROW_SUBMODULE_DATA: &str = "data";
+
+const PARQUET_ENV: &str = "PARQUET_TEST_DATA";
+const PARQUET_SUBMODULE: &str = "cpp/submodules/parquet-testing";
+const PARQUET_SUBMODULE_DATA: &str = "data";
+
+/// Gets arrow test data dir. Panic on error.
+#[allow(non_snake_case)]
+pub fn ARROW_TEST_DATA() -> String {

Review comment:
       nit: I would not have used upper case. The fact that the env variable is upper case is irrelevant to the function name. If we plan to have all tests use this, then the user (writing tests) would not even understand why the function is upper case as the env variable becomes opaque to them.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org