dataform icon indicating copy to clipboard operation
dataform copied to clipboard

Update unit test's result messages

Open spider-man-tm opened this issue 1 year ago • 1 comments

This PR is linked to the following issue:

close #1791

Current

Prepare the following table and its corresponding unit test.

Test table:

config {
    type: "table",
    schema: "hoge",
    name: "fuga"
}

select
  user_id
from
  ${ref("users")}

Test code:

config {
  type: "test",
  dataset: "fuga",
}

select 1 as user_id union all
select cast(null as int64) as user_id

input "users" {
  select 1 as user_id union all
  select 2 as user_id
}

Given that the expected block includes cast(null as int64), it would be more user-friendly to have the output display as follows:

For row 1 and column "user_id": expected null, but saw "2"

However, the current output is as follows, which can cause confusion for the user:

For row 1 and column "user_id": expected type "object", but saw type "number".

Before Committing

  • Conducted unit testing
  • Checked the behavior of dataform cli

spider-man-tm avatar Aug 16 '24 13:08 spider-man-tm

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Aug 16 '24 13:08 google-cla[bot]

I've run the tests, and all pass. Will merge, thanks for doing this!

Ekrekr avatar Sep 05 '24 15:09 Ekrekr