You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getCloudDatasetIdForLocalDataset is dead for every real dataset; port dataset.isInCloud() #95
ndi_dataset has no database attribute. Its only properties are reference and cloud_client; the database lives on the backing session (dataset._session._database), and the class exposes it only through the database_add / database_search / database_rm methods. So dataset.database raises AttributeError on every call, the bare except Exception: pass swallows it, and the function reports "never uploaded" for every dataset that has in fact been uploaded.
This is not cosmetic: src/ndi/cloud/orchestration.py:397-403 auto-detects the cloud id through this function, so the auto-detect path is permanently broken. It went unnoticed because every test mocks the function out.
Fix: accept either shape — a database attribute when present, otherwise dataset._session._database — and return early with a debug log rather than swallowing. Drop the bare except Exception: pass; it is what hid this for as long as it did. Reference: commit 1833a09.
Test: the regression test must use a realndi_dataset, not a mock. Mocking is precisely what let this ship.
It answers the same question as item 1 and must agree with it, so the two belong in one change: implement isInCloud() on ndi_dataset over the same dataset_remote lookup, and cross-reference them in the docstrings.
Test:isInCloud() makes no network call, and the test should measure that rather than assert it in prose — PR #61 commit 0e1738b exists solely because the first version of that test claimed no-network without checking. Reference commits: 490412e, 0e1738b.
Effort
Small — both changes are contained in src/ndi/cloud/internal.py and src/ndi/dataset/_dataset.py, with no dependency on the file-services rework that made other PR #61 patches unportable.
Activity