tisonkun commented on code in PR #162:
URL: https://github.com/apache/datasketches-rust/pull/162#discussion_r3648792128
##########
tools/download_serialization_test_data.py:
##########
@@ -102,26 +88,28 @@ def main():
parser.add_argument("--all", action="store_true", help="Download all test
data")
args = parser.parse_args()
+ repository_root = Path(__file__).resolve().parents[1]
+ serialization_test_data = repository_root / "datasketches" / "tests" /
"serialization_test_data"
+ generated_targets = {
+ "cpp": serialization_test_data / "cpp_generated_files",
+ "java": serialization_test_data / "java_generated_files",
+ }
+
languages = []
if args.java or args.all:
languages.append("java")
if args.cpp or args.all:
languages.append("cpp")
if not languages:
- languages = list(OUTPUT_DIRS)
-
- repository_root = Path(__file__).resolve().parents[1]
- project_dir = repository_root / "datasketches"
+ languages = list(generated_targets)
with tempfile.TemporaryDirectory(prefix="datasketches-tck-") as temp_dir:
archive_path = Path(temp_dir) / "datasketches-tck.zip"
download_archive(archive_path)
with zipfile.ZipFile(archive_path) as archive:
for language in languages:
- extract_snapshots(archive, project_dir, language)
-
- return 0
+ extract_snapshots(archive, generated_targets[language],
language)
if __name__ == "__main__":
- sys.exit(main())
+ main()
Review Comment:
Nope. Every branch returns 0 so we don't need it until we need it.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]