ONE-api 3.3.0__py3-none-any.whl → 3.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
one/util.py CHANGED
@@ -351,7 +351,7 @@ def filter_revision_last_before(
351
351
  A revision string to match (regular expressions not permitted).
352
352
  assert_unique : bool
353
353
  When true an alferr.ALFMultipleRevisionsFound exception is raised when multiple
354
- default revisions are found; an alferr.ALFError when no default revision is found.
354
+ default revisions are found; an alferr.ALFWarning when no default revision is found.
355
355
  assert_consistent : bool
356
356
  Will raise alferr.ALFMultipleRevisionsFound if matching revision is different between
357
357
  datasets.
@@ -379,6 +379,17 @@ def filter_revision_last_before(
379
379
  revision specified. This is typically an error in the cache table itself as all datasets
380
380
  should have one and only one default revision specified.
381
381
 
382
+ Warnings
383
+ --------
384
+ one.alf.exceptions.ALFWarning
385
+ When the 'default_revision' column exists and no revision is passed, this warning means
386
+ that one or more matching datasets have no default revision specified. This is typically
387
+ an error in the cache table itself as all datasets should have one and only one default
388
+ revision specified. It may be that the default revision is unavailable (e.g. deleted).
389
+ one.alf.exceptions.ALFWarning
390
+ When `assert_consistent` is False, this warning may mean that the matching datasets have
391
+ mixed revisions.
392
+
382
393
  Notes
383
394
  -----
384
395
  - When `revision` is not None, the default revision value is not used. If an older revision is
@@ -400,9 +411,6 @@ def filter_revision_last_before(
400
411
  return df[df.default_revision]
401
412
  if len(df) == 1: # This may be the case when called from load_datasets
402
413
  return df # It's not the default but there's only one available revision
403
- # default_revision column all False; default isn't copied to remote repository
404
- if assert_unique:
405
- raise alferr.ALFError(f'No default revision for dataset {dset_name}')
406
414
  warnings.warn(
407
415
  f'No default revision for dataset {dset_name}; using most recent',
408
416
  alferr.ALFWarning)