Skip to content

Commit

Permalink
Merge pull request #386 from dandi/workaround-no-summary
Browse files Browse the repository at this point in the history
Disable summary stats temporarily
  • Loading branch information
waxlamp authored Jul 2, 2021
2 parents da32e0e + 32d62a9 commit 93faf5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dandiapi/api/models/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ def _populate_metadata(self, version_with_assets: Version = None):
'numberOfBytes': 0,
'numberOfFiles': 0,
}
if version_with_assets.id:
# TODO: remove the `and False` and find a better way to handle the
# unconditional recomputation of the summary stats.
if version_with_assets.id and False:
try:
summary = aggregate_assets_summary(
[asset.metadata.metadata for asset in version_with_assets.assets.all()]
Expand Down
3 changes: 3 additions & 0 deletions dandiapi/api/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def test_validate_asset_metadata_malformed_keywords(asset: Asset):
)


@pytest.mark.skip(reason='https://github.com/dandi/dandi-api/pull/386')
@pytest.mark.django_db
def test_validate_version_metadata(version: Version, asset: Asset):
version.assets.add(asset)
Expand Down Expand Up @@ -241,6 +242,7 @@ def test_validate_version_metadata_malformed_schema_version(version: Version, as
assert version.validation_error.startswith('Metadata version xxx is not allowed.')


@pytest.mark.skip(reason='https://github.com/dandi/dandi-api/pull/386')
@pytest.mark.django_db
def test_validate_version_metadata_no_description(version: Version, asset: Asset):
version.assets.add(asset)
Expand All @@ -260,6 +262,7 @@ def test_validate_version_metadata_no_description(version: Version, asset: Asset
)


@pytest.mark.skip(reason='https://github.com/dandi/dandi-api/pull/386')
@pytest.mark.django_db
def test_validate_version_metadata_malformed_license(version: Version, asset: Asset):
version.assets.add(asset)
Expand Down
4 changes: 4 additions & 0 deletions dandiapi/api/tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_version_make_version_save(mocker, dandiset, published_version_factory):
assert version_1.version != version_str_2


@pytest.mark.skip(reason='https://github.com/dandi/dandi-api/pull/386')
@pytest.mark.django_db
def test_version_metadata_computed(version, version_metadata):
original_metadata = version_metadata.metadata
Expand Down Expand Up @@ -352,6 +353,7 @@ def test_version_rest_info_with_asset(
}


@pytest.mark.skip(reason='https://github.com/dandi/dandi-api/pull/386')
@pytest.mark.django_db
def test_version_rest_update(api_client, user, draft_version):
assign_perm('owner', user, draft_version.dandiset)
Expand Down Expand Up @@ -407,6 +409,7 @@ def test_version_rest_update(api_client, user, draft_version):
assert draft_version.metadata.name == new_name


@pytest.mark.skip(reason='https://github.com/dandi/dandi-api/pull/386')
@pytest.mark.django_db
def test_version_rest_update_large(api_client, user, draft_version):
assign_perm('owner', user, draft_version.dandiset)
Expand Down Expand Up @@ -497,6 +500,7 @@ def test_version_rest_update_not_an_owner(api_client, user, version):
)


@pytest.mark.skip(reason='https://github.com/dandi/dandi-api/pull/386')
@pytest.mark.django_db
# TODO change admin_user back to a normal user once publish is allowed
def test_version_rest_publish(api_client, admin_user: User, draft_version: Version, asset: Asset):
Expand Down

0 comments on commit 93faf5f

Please sign in to comment.