Skip to content

Tests (DuckDB error) - Malformed JSON at byte 0 of input #5387

Description

@jukiewiczm

SQLMesh version: 0.206.1 / 0.216.0

There's been (I think) a regression within tests definition between version 0.187.6 and 0.206.1 (not necessarily exactly these versions, this is the point at which I've noticed it).

I have a model that has a nullable JSON column in DuckDB (Motherduck to be precise, though I believe it doesn't matter for tests).
When specifying test example in the .yaml file, I could previously simply omit that column in the inputs section.

After upgrading SQLMesh, I'm getting the following error when running the tests:
duckdb.duckdb.InvalidInputException: Invalid Input Error: Malformed JSON at byte 0 of input: unexpected character. Input: "None"

To fix this, I need to input an empty JSON to the column, like this

test_example:
  model: '"db"."my_model"'
  inputs:
    '"db"."my_model_raw"':
      - id: 5
        json_col: "{}"

The problem with that is that I have plenty of columns like this, so fixing it this way makes the tests very hard to read.
Please consider fixing it if it's indeed a regression. If it's not, I'd be happy to get to know how to work around it, if possible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions