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 2022/02/14 16:00:18 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #12409: ARROW-15668: Simplified skip logic in integration tests

pitrou commented on a change in pull request #12409:
URL: https://github.com/apache/arrow/pull/12409#discussion_r805982245



##########
File path: ci/conda_env_archery.txt
##########
@@ -17,6 +17,7 @@
 
 # cli
 click
+pydantic

Review comment:
       Can you move this under a `#integration` header instead?

##########
File path: dev/archery/archery/integration/capabilities.py
##########
@@ -0,0 +1,53 @@
+# 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.
+
+from typing import Set
+import os.path
+
+import pydantic
+import ruamel.yaml
+
+
+class Capabilities(pydantic.BaseModel):
+    """
+    A set of capabilies of a language
+    """
+    name: str
+    # the set of capabilities that are currently not supported
+    # by a given language
+    # these currently must be integration test cases as defined
+    # in ``datagen.CASES``
+    unsupported: Set[str]
+
+
+# the set of languages supported to run integration tests
+# To add a new language (X):
+# 1. add it here
+# 2. pipe the language through the CLI call (e.g. ``with_X```)

Review comment:
       ```suggestion
   # 2. pipe the language through the CLI call (add a ``with_X``` option)
   ```

##########
File path: dev/archery/archery/integration/runner.py
##########
@@ -129,6 +136,11 @@ def _gold_tests(self, gold_dir):
                 skip = set()
             if name == 'union' and prefix == '0.17.1':
                 skip.add("Java")
+            if name == 'dictionary' and prefix == '0.14.1':
+                skip.add("Go")
+                skip.add("C#")
+            if name == 'decimal' and prefix == '0.14.1':
+                skip.add("Rust")

Review comment:
       So the "unsupported golden" entry in the YAML file isn't used (yet)?

##########
File path: dev/archery/archery/integration/runner.py
##########
@@ -25,6 +25,10 @@
 import sys
 import tempfile
 import traceback
+from typing import List, Optional
+from archery.integration.capabilities import LANGUAGES, language_capabilities

Review comment:
       Can you use the same conventions for local imports as below (i.e. use relative imports)?

##########
File path: dev/.gitignore
##########
@@ -17,4 +17,5 @@
 
 # Python virtual environments for dev tools
 .venv*/
+venv/

Review comment:
       Why not reuse the same `.venv` convention as above?

##########
File path: dev/archery/archery/integration/datagen.py
##########
@@ -1574,120 +1575,48 @@ def generate_extension_case():
                           dictionaries=[dict0])
 
 
-def get_generated_json_files(tempdir=None):
+CASES = {
+    "no_batches": lambda: generate_primitive_case([]),
+    "null": lambda: generate_null_case([10, 0]),
+    "null_zerolength": lambda: generate_null_trivial_case([0, 0]),
+    "primitive": lambda: generate_primitive_case([17, 20]),
+    "primitive_zerolength": lambda: generate_primitive_case([0, 0, 0]),
+    "primitive_large_offsets":
+        lambda: generate_primitive_large_offsets_case([17, 20]),
+    "decimal128": generate_decimal128_case,
+    "decimal256": generate_decimal256_case,
+    "datetime": generate_datetime_case,
+    "duration": generate_duration_case,
+    "interval": generate_interval_case,
+    "interval_mdn": generate_month_day_nano_interval_case,

Review comment:
       Nit, but "interval_month_day_nano" would be more immediately readable :-)

##########
File path: dev/archery/archery/integration/capabilities.py
##########
@@ -0,0 +1,53 @@
+# 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.
+
+from typing import Set
+import os.path
+
+import pydantic
+import ruamel.yaml
+
+
+class Capabilities(pydantic.BaseModel):
+    """
+    A set of capabilies of a language
+    """
+    name: str
+    # the set of capabilities that are currently not supported
+    # by a given language
+    # these currently must be integration test cases as defined
+    # in ``datagen.CASES``
+    unsupported: Set[str]
+
+
+# the set of languages supported to run integration tests
+# To add a new language (X):
+# 1. add it here
+# 2. pipe the language through the CLI call (e.g. ``with_X```)
+# 3. add a file "X.yaml" to ``languages`` with what the
+#    language does not support
+LANGUAGES = ["cpp", "java", "go", "rust", "csharp", "javascript"]
+
+
+def language_capabilities(language: str) -> Capabilities:
+    """
+    Reads ``Capabilities`` of a given language

Review comment:
       ```suggestion
       Read the ``Capabilities`` of a given language
   ```

##########
File path: dev/archery/archery/integration/languages/cpp.yaml
##########
@@ -0,0 +1,19 @@
+# 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.
+
+name: "C++"
+unsupported: []

Review comment:
       This could also go into a single file `languages.yaml` for all languages, what do you think?




-- 
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: github-unsubscribe@arrow.apache.org

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