Check status of data items in a cloud-agnostic way. Args: objs: objects to check status for. jobs: number of jobs that can be running simultaneously. remote: optional remote to compare cache to. By default remote from core.remote config op
(
self,
objs: Iterable["HashInfo"],
jobs: Optional[int] = None,
remote: Optional[str] = None,
odb: Optional["HashFileDB"] = None,
)
| 288 | ) |
| 289 | |
| 290 | def status( |
| 291 | self, |
| 292 | objs: Iterable["HashInfo"], |
| 293 | jobs: Optional[int] = None, |
| 294 | remote: Optional[str] = None, |
| 295 | odb: Optional["HashFileDB"] = None, |
| 296 | ): |
| 297 | """Check status of data items in a cloud-agnostic way. |
| 298 | |
| 299 | Args: |
| 300 | objs: objects to check status for. |
| 301 | jobs: number of jobs that can be running simultaneously. |
| 302 | remote: optional remote to compare |
| 303 | cache to. By default remote from core.remote config option |
| 304 | is used. |
| 305 | odb: optional ODB to check status from. Overrides remote. |
| 306 | """ |
| 307 | from dvc_data.hashfile.status import CompareStatusResult |
| 308 | |
| 309 | if odb is not None: |
| 310 | return self._status(objs, jobs=jobs, odb=odb) |
| 311 | result = CompareStatusResult(set(), set(), set(), set()) |
| 312 | legacy_objs, default_objs = _split_legacy_hash_infos(objs) |
| 313 | if legacy_objs: |
| 314 | odb = self.get_remote_odb(remote, "status", hash_name="md5-dos2unix") |
| 315 | assert odb.hash_name == "md5-dos2unix" |
| 316 | o, m, n, d = self._status(legacy_objs, jobs=jobs, odb=odb) |
| 317 | result.ok.update(o) |
| 318 | result.missing.update(m) |
| 319 | result.new.update(n) |
| 320 | result.deleted.update(d) |
| 321 | if default_objs: |
| 322 | odb = self.get_remote_odb(remote, "status") |
| 323 | o, m, n, d = self._status(default_objs, jobs=jobs, odb=odb) |
| 324 | result.ok.update(o) |
| 325 | result.missing.update(m) |
| 326 | result.new.update(n) |
| 327 | result.deleted.update(d) |
| 328 | return result |
| 329 | |
| 330 | def _status( |
| 331 | self, |
nothing calls this directly
no test coverage detected