Skip to content

Apache DataFusion SQL Query Engine

ARROW-9180: [Developer] Remove usage of whitelist, blacklist, slave, etc.

Krisztián Szűcsdcc06f930a6f
diff --git a/ci/docker/conda-r.dockerfile b/ci/docker/conda-r.dockerfile
index ad8e59fb2a..79b6ebc3b2 100644
--- a/ci/docker/conda-r.dockerfile
+++ b/ci/docker/conda-r.dockerfile
@@ -36,7 +36,7 @@ RUN conda install -q \
conda clean --all
# Ensure parallel compilation of of C/C++ code
-RUN echo "MAKEFLAGS=-j$(R --slave -e 'cat(parallel::detectCores())')" >> $CONDA_PREFIX/lib/R/etc/Makeconf
+RUN echo "MAKEFLAGS=-j$(R -s -e 'cat(parallel::detectCores())')" >> $CONDA_PREFIX/lib/R/etc/Makeconf
ENV ARROW_BUILD_STATIC=OFF \
ARROW_BUILD_TESTS=OFF \
diff --git a/ci/docker/linux-apt-r.dockerfile b/ci/docker/linux-apt-r.dockerfile
index 7f81e11e54..85827358df 100644
--- a/ci/docker/linux-apt-r.dockerfile
+++ b/ci/docker/linux-apt-r.dockerfile
@@ -64,7 +64,7 @@ RUN apt-get update -y && \
COPY ci/etc/rprofile /arrow/ci/etc/
RUN cat /arrow/ci/etc/rprofile >> $(R RHOME)/etc/Rprofile.site
# Also ensure parallel compilation of C/C++ code
-RUN echo "MAKEFLAGS=-j$(R --slave -e 'cat(parallel::detectCores())')" >> $(R RHOME)/etc/Makeconf
+RUN echo "MAKEFLAGS=-j$(R -s -e 'cat(parallel::detectCores())')" >> $(R RHOME)/etc/Makeconf
COPY ci/scripts/r_deps.sh /arrow/ci/scripts/
COPY r/DESCRIPTION /arrow/r/
diff --git a/ci/docker/linux-r.dockerfile b/ci/docker/linux-r.dockerfile
index d23b802c55..5de562d55c 100644
--- a/ci/docker/linux-r.dockerfile
+++ b/ci/docker/linux-r.dockerfile
@@ -28,7 +28,7 @@ ENV PATH "${RPREFIX}/bin:${PATH}"
COPY ci/etc/rprofile /arrow/ci/etc/
RUN cat /arrow/ci/etc/rprofile >> $(R RHOME)/etc/Rprofile.site
# Also ensure parallel compilation of C/C++ code
-RUN echo "MAKEFLAGS=-j$(R --slave -e 'cat(parallel::detectCores())')" >> $(R RHOME)/etc/Makeconf
+RUN echo "MAKEFLAGS=-j$(R -s -e 'cat(parallel::detectCores())')" >> $(R RHOME)/etc/Makeconf
# Workaround for html help install failure; see https://github.com/r-lib/devtools/issues/2084#issuecomment-530912786
RUN Rscript -e 'x <- file.path(R.home("doc"), "html"); if (!file.exists(x)) {dir.create(x, recursive=TRUE); file.copy(system.file("html/R.css", package="stats"), x)}'
diff --git a/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile b/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile
index a865f9fe70..4c96b64669 100644
--- a/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile
+++ b/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile
@@ -60,7 +60,7 @@ RUN printf "\
>> /usr/local/RDsan/lib/R/etc/Rprofile.site
# Also ensure parallel compilation of C/C++ code
-RUN echo "MAKEFLAGS=-j$(R --slave -e 'cat(parallel::detectCores())')" >> /usr/local/RDsan/lib/R/etc/Makeconf
+RUN echo "MAKEFLAGS=-j$(R -s -e 'cat(parallel::detectCores())')" >> /usr/local/RDsan/lib/R/etc/Makeconf
# Prioritize system packages and local installation
# The following dependencies will be downloaded due to missing/invalid packages
diff --git a/dev/archery/archery/cli.py b/dev/archery/archery/cli.py
index 82ab56a852..a8a779951e 100644
--- a/dev/archery/archery/cli.py
+++ b/dev/archery/archery/cli.py
@@ -318,9 +318,11 @@ def lint(ctx, src, fix, iwyu_all, **checks):
@click.option("--src", metavar="<arrow_src>", default=None,
callback=validate_arrow_sources,
help="Specify Arrow source directory")
[email protected]("--whitelist", "-w", help="Allow only these rules")
[email protected]("--blacklist", "-b", help="Disallow these rules")
-def numpydoc(src, symbols, whitelist, blacklist):
[email protected]("--allow-rule", "-a", multiple=True,
+ help="Allow only these rules")
[email protected]("--disallow-rule", "-d", multiple=True,
+ help="Disallow these rules")
+def numpydoc(src, symbols, allow_rule, disallow_rule):
"""
Pass list of modules or symbols as arguments to restrict the validation.
@@ -332,10 +334,10 @@ def numpydoc(src, symbols, whitelist, blacklist):
archery numpydoc pyarrow.csv pyarrow.json pyarrow.parquet
archery numpydoc pyarrow.array
"""
- blacklist = blacklist or {'GL01', 'SA01', 'EX01', 'ES01'}
+ disallow_rule = disallow_rule or {'GL01', 'SA01', 'EX01', 'ES01'}
try:
- results = python_numpydoc(symbols, whitelist=whitelist,
- blacklist=blacklist)
+ results = python_numpydoc(symbols, allow_rules=allow_rule,
+ disallow_rule=disallow_rule)
for result in results:
result.ok()
except LintValidationException:
diff --git a/dev/archery/archery/lang/python.py b/dev/archery/archery/lang/python.py
index 9b79971203..4952d5f230 100644
--- a/dev/archery/archery/lang/python.py
+++ b/dev/archery/archery/lang/python.py
@@ -187,8 +187,8 @@ class NumpyDoc:
Docstring._load_obj = orig_load_obj
inspect.signature = orig_signature
- def validate(self, from_package='', rules_blacklist=None,
- rules_whitelist=None):
+ def validate(self, from_package='', allow_rules=None,
+ disallow_rules=None):
results = []
def callback(obj):
@@ -196,9 +196,9 @@ class NumpyDoc:
errors = []
for errcode, errmsg in result.get('errors', []):
- if rules_whitelist and errcode not in rules_whitelist:
+ if allow_rules and errcode not in allow_rules:
continue
- if rules_blacklist and errcode in rules_blacklist:
+ if disallow_rules and errcode in disallow_rules:
continue
errors.append((errcode, errmsg))
diff --git a/dev/archery/archery/utils/lint.py b/dev/archery/archery/utils/lint.py
index ed31b23b70..e4bc6e35dc 100644
--- a/dev/archery/archery/utils/lint.py
+++ b/dev/archery/archery/utils/lint.py
@@ -170,7 +170,7 @@ def python_linter(src, fix=False):
check=False))
-def python_numpydoc(symbols=None, whitelist=None, blacklist=None):
+def python_numpydoc(symbols=None, allow_rules=None, disallow_rules=None):
"""Run numpydoc linter on python.
Pyarrow must be available for import.
@@ -203,8 +203,8 @@ def python_numpydoc(symbols=None, whitelist=None, blacklist=None):
results = numpydoc.validate(
# limit the validation scope to the pyarrow package
from_package='pyarrow',
- rules_whitelist=whitelist,
- rules_blacklist=blacklist
+ allow_rules=allow_rules,
+ disallow_rules=disallow_rules
)
if len(results) == 0: