mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-27 07:18:28 +01:00
exp show: don't cache collection errors
This commit is contained in:
committed by
Peter Rowlands (변기호)
parent
83835afa69
commit
1d2892efac
@@ -117,6 +117,16 @@ class SerializableExp:
|
||||
except (TypeError, json.JSONDecodeError) as exc:
|
||||
raise DeserializeError("failed to load SerializableExp") from exc
|
||||
|
||||
@property
|
||||
def contains_error(self) -> bool:
|
||||
return (
|
||||
self.error is not None
|
||||
or self.params.get("error")
|
||||
or any(value.get("error") for value in self.params.values())
|
||||
or self.metrics.get("error")
|
||||
or any(value.get("error") for value in self.metrics.values())
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class _ExpDep:
|
||||
|
||||
@@ -97,14 +97,12 @@ def collect_experiment_commit(
|
||||
force=force,
|
||||
**kwargs,
|
||||
)
|
||||
if exp_rev != "workspace" and not param_deps:
|
||||
if exp_rev != "workspace" and not param_deps and not exp.contains_error:
|
||||
cache.put(exp, force=True)
|
||||
return _format_exp(exp)
|
||||
except Exception as exc: # noqa: BLE001, pylint: disable=broad-except
|
||||
logger.debug("", exc_info=True)
|
||||
error = SerializableError(str(exc), type(exc).__name__)
|
||||
if not (exp_rev == "workspace" or param_deps or status == ExpStatus.Running):
|
||||
cache.put(error, rev=exp_rev, force=True)
|
||||
return _format_error(error)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user