Skip to content

CI Fix - Clickhouse Failing Sometimes #5973

Description

@cmgoffena13

Link: https://github.com/SQLMesh/sqlmesh/actions/runs/32190188666/job/95882655785

AI Notes

Failing Test
tests/core/engine_adapter/integrationtest_integration_clickhouse.py::test_insert_overwrite_by_condition_by_key_partitioned[[query]clickhouse_cluster]

What’s Wrong
After a unique-key insert overwrite, id=4 should be 2024-05-01 but the table has 2024-05-02. The assert also looks totally broken because ClickHouse returns dates as unix seconds and the test expects pandas nanoseconds, so every row looks wrong even when most dates match.

Possible Fix
Make the unique-key path pick a deterministic row for duplicates (e.g. ordered), and/or normalize date comparison in compare_with_current so ClickHouse dates compare as real dates, not raw ints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingEngine: ClickhouseIssues related to Clickhouse

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions