Skip to content

(cubes[1].includes = () => '*') must be one of [*, array]Β #9410

@AndreasTA-AW

Description

@AndreasTA-AW

Describe the bug
While trying to generate dynamic models I get a weird error when generating the views:

Error: Error: Compile errors:
xxxxxxxxx cube: (cubes[1].includes = () => '*') must be one of [*, array]

But! The include is set like below, so it doesn't make sense, I can't remove the function that someone else is generating behind the scene?
includes: *,

To Reproduce
Steps to reproduce the behavior:

I'm reading a DBT yaml file, generating cubes and views from this.
When adding the views with multiple cubes I get this error. It says that join_path has to be a function, and that works.

Expected behavior
Well, I'm not making it a function and if it should not be a function I'm not sure how I should type it to work. I want it to compile and show my views/cubes.

dps = [
   {
       view: "some_name",
      name: "some_cube_name",
      joins: [
        {
            name: "another_cube_joined"
        }
      ]
  }
]

dps.forEach((dp) => {
    view(dp.view, {
      cubes: [
        {
          join_path: () => dp.name,
          includes: `*`,
        },
      ].concat(
        dp.joins?.map((j) => ({
          join_path: () => `${dp.name}.${j.name}`,
          includes: `*`,
          prefix: true,
        })) ?? []
      ),
    });
  });

Version:
1.2.27

Metadata

Metadata

Assignees

Labels

questionThe issue is a question. Please use Stack Overflow for questions.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions