Skip to content

[BUG] Panic at crates\dbt-tasks\src\utils.rs: byte index 4152 is out of bounds of -- funcsign: (string) -> string` #1009

@sophieml

Description

@sophieml

Describe the bug
Following panic occurs in LSP:

[Info  - 7:45:32 AM] Full compilation complete - 339ms

thread 'tokio-runtime-worker' panicked at crates\dbt-tasks\src\utils.rs:626:24:
byte index 4152 is out of bounds of `-- funcsign: (string) -> string
{% macro resolve_model_name(input_model_name) %}
    {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}
{% endmacro %}

-- funcsign: (string) -> string
{%- macro default__resolve_model_name(input_m`[...]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

What version of dbt Fusion is this bug in? (find out by running dbt --version)
dbt Extension v0.21.4
LSP v2.0.0-preview.56
on Snowflake

Is this a discrepancy between the dbt Fusion Engine and dbt Core? Check one.

  • YES
  • NO

To Reproduce
create a model:

-- model.sql
WITH cte AS (
    SELECT
        1 AS foo
)

SELECT * FROM cte
  1. Preview model with ctrl+enter or click "Preview CTE"
  2. edit model to:
-- model.sql
WITH cte AS (
    SELECT
        1 AS foo
        , 2 AS bar
)

SELECT * FROM cte
  1. save model, observe panic

Expected behavior
LSP does not panic

Operating System and CPU Type (please complete the following information):
Windows x86

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions