Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Cube check on dimensions #1186

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ You can also check the [release page](https://github.com/visualize-admin/visuali

## Unreleased

Nothing yet.
- Fixes
- Cube checker now correctly checks if dimensions are present

# [3.22.6] - 2023-09-19

Expand Down
14 changes: 11 additions & 3 deletions app/pages/_cube-checker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import DataLoader from "dataloader";
import omit from "lodash/omit";
import { GetServerSideProps, NextPage } from "next";
import rdf from "rdf-ext";
import React from "react";
import StreamClient from "sparql-http-client";
import ParsingClient from "sparql-http-client/ParsingClient";

Expand Down Expand Up @@ -148,8 +147,17 @@ const checks: Check[] = [
description: "Should have a number of dimensions",
run: async ({ cubeIri, loaders }) => {
const dimensions = await loaders.getCubeDimensions.load(cubeIri);
console.log(dimensions);
return { ok: true, message: `Has ${dimensions?.length} dimensions` };
if (dimensions) {
return {
ok: true,
message: `Has ${dimensions.length} dimensions`,
};
} else {
return {
ok: false,
message: "No dimensions",
};
}
},
},
{
Expand Down