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

Assertions are not executed properly #1756

Closed
kajen3 opened this issue Jun 18, 2024 · 2 comments
Closed

Assertions are not executed properly #1756

kajen3 opened this issue Jun 18, 2024 · 2 comments

Comments

@kajen3
Copy link

kajen3 commented Jun 18, 2024

I've created a simple .sqlx file with the following content inside the definitions folder:

config {
    type: "table",
    schema: "dev",
    name: "revenue",
    assertions: {
        uniqueKeys: [
            ["date"],
            ["store"]
        ]
    }
}

SELECT
  date,
  store,
  net_revenue,
  net_revenue_food
FROM
  ${ref("store_revenue_view")}

While the query itself works fine, it seems that the assertions are not executed properly. The error message says:

Invalid value: Invalid dataset ID "...b0a.". Dataset IDs must be alphanumeric (plus underscores) and must be at most 1024 characters long. at [2:3] at [8:5] 

The dataset id is alphanumeric, but I've spotted a difference in the second line of the executed code. The code that fails (assertions) looks as follows:

BEGIN
  CREATE SCHEMA IF NOT EXISTS `...b0a.` OPTIONS(location="europe-west1");
...

while the first two lines of the job itself look as follows:

BEGIN
  CREATE SCHEMA IF NOT EXISTS `...b0a.dev` OPTIONS(location="europe-west1");
...
@btelFD
Copy link

btelFD commented Aug 6, 2024

There is a long standing bug, that schema/database overrides in definitions do not work for the inbuild assertions.
This seems to be a bug since December of 21 (See #1295 )

@Ekrekr
Copy link
Contributor

Ekrekr commented Aug 16, 2024

Thanks for the report - I'm marking this as a duplicate of #1295

@Ekrekr Ekrekr closed this as completed Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants