csaybar commited on
Commit
75287e5
·
verified ·
1 Parent(s): 8e72867

Optimize remote fixture verification

Browse files
Files changed (3) hide show
  1. README.md +5 -0
  2. verify/_common.py +4 -0
  3. verify/verify_huggingface.py +6 -0
README.md CHANGED
@@ -99,6 +99,11 @@ After publication:
99
  python verify/verify_huggingface.py --revision main
100
  ```
101
 
 
 
 
 
 
102
  The generator seed, source revision, and source manifest checksum are pinned.
103
  Regeneration preserves the logical datasets and synthetic metadata. ZIP byte
104
  checksums may change when ZIP timestamps change, so published revisions should
 
99
  python verify/verify_huggingface.py --revision main
100
  ```
101
 
102
+ The default remote verifier opens all 40 ZIP-backed entrypoints and decodes
103
+ every Rumi through an HTTP subfile location. Pass `--full-api` to additionally
104
+ repeat the schema, raw-level, wide-layout, and `location=False` checks that the
105
+ local verifier already performs.
106
+
107
  The generator seed, source revision, and source manifest checksum are pinned.
108
  Regeneration preserves the logical datasets and synthetic metadata. ZIP byte
109
  checksums may change when ZIP timestamps change, so published revisions should
verify/_common.py CHANGED
@@ -156,6 +156,7 @@ def verify_dataset(
156
  source_fixtures: dict[str, dict[str, Any]],
157
  *,
158
  check_payload_names: bool = False,
 
159
  ) -> dict[str, int]:
160
  if isinstance(source, Path):
161
  report = taco.validate(source)
@@ -189,6 +190,9 @@ def verify_dataset(
189
  if actual != fixture["array_sha256"]:
190
  raise AssertionError(f"decoded Rumi mismatch for {record['id']}/{row['rumi:source_fixture']}")
191
 
 
 
 
192
  quiet = taco.read(dataset, layout="long", location=False)
193
  if "taco:location" not in quiet.column_names or any(quiet["taco:location"].to_pylist()):
194
  raise AssertionError(f"location=False failed for {record['id']}")
 
156
  source_fixtures: dict[str, dict[str, Any]],
157
  *,
158
  check_payload_names: bool = False,
159
+ full_api: bool = True,
160
  ) -> dict[str, int]:
161
  if isinstance(source, Path):
162
  report = taco.validate(source)
 
190
  if actual != fixture["array_sha256"]:
191
  raise AssertionError(f"decoded Rumi mismatch for {record['id']}/{row['rumi:source_fixture']}")
192
 
193
+ if not full_api:
194
+ return {"samples": record["samples"], "assets": long.num_rows}
195
+
196
  quiet = taco.read(dataset, layout="long", location=False)
197
  if "taco:location" not in quiet.column_names or any(quiet["taco:location"].to_pylist()):
198
  raise AssertionError(f"location=False failed for {record['id']}")
verify/verify_huggingface.py CHANGED
@@ -17,6 +17,11 @@ def main() -> None:
17
  parser = argparse.ArgumentParser(description=__doc__)
18
  parser.add_argument("--repository", default=DEFAULT_REPOSITORY)
19
  parser.add_argument("--revision", required=True)
 
 
 
 
 
20
  args = parser.parse_args()
21
 
22
  manifest_url = _url(args.repository, args.revision, "manifest.json")
@@ -36,6 +41,7 @@ def main() -> None:
36
  record,
37
  cases[record["case"]],
38
  manifest["source_fixtures"],
 
39
  )
40
  totals["samples"] += result["samples"]
41
  totals["assets"] += result["assets"]
 
17
  parser = argparse.ArgumentParser(description=__doc__)
18
  parser.add_argument("--repository", default=DEFAULT_REPOSITORY)
19
  parser.add_argument("--revision", required=True)
20
+ parser.add_argument(
21
+ "--full-api",
22
+ action="store_true",
23
+ help="repeat local schema, raw-level, wide-layout, and location-disabled checks remotely",
24
+ )
25
  args = parser.parse_args()
26
 
27
  manifest_url = _url(args.repository, args.revision, "manifest.json")
 
41
  record,
42
  cases[record["case"]],
43
  manifest["source_fixtures"],
44
+ full_api=args.full_api,
45
  )
46
  totals["samples"] += result["samples"]
47
  totals["assets"] += result["assets"]