https://dagster.io/ logo
#ask-ai
Title
# ask-ai
j

Joram Sbrisny

02/28/2024, 2:36 PM
@Scout: what could be the problem with the source.yml when i get following error message: Member of sequence mismatches type. Expected <class 'str'>. Got ['pba', 'raw_data'] of type <class 'list'> . here my source.yml
Copy code
- name: pba
  schema: raw_data
  tables:
    - name: NINA_FONDS_ME_GESAMT
    - name: pba_ora_dm_vertrieb_tbl
      meta:
        dagster:
          asset_key: ["leben","ba_provision", "raw_data", "pba_ora_dm_vertrieb_tbl"]
and here my model:
Copy code
{{
    config
    (
      materialized = 'incremental',
      unique_key= 'sid',
      on_schema_change='append_new_columns',
      alias = 'NINA_DEKA_ETL_LAUF',
      schema = 'STA',
      tags = ["deka","deka-etl"]
    )
}}

-- Das muss als erstes laufen, da die IDs pro Lauf hier bestimmt werden
-- Run lvl 1

with lauf_id as (
select
1  as test
from {{ source('pba', 'NINA_FONDS_ME_GESAMT') }}
)

select lauf_id.test
 from lauf_id
s

Scout

02/28/2024, 2:36 PM
The error message you're encountering suggests that there is a type mismatch in the
source.yml
file, where a string is expected but a list is provided instead. The specific part of the
source.yml
that seems to be causing the issue is the
asset_key
definition under the
meta
property for the
pba_ora_dm_vertrieb_tbl
table. Here's the relevant part of your `source.yml`:
Copy code
yaml - name: pba_ora_dm_vertrieb_tbl   meta:     dagster:       asset_key: ["leben","ba_provision", "raw_data", "pba_ora_dm_vertrieb_tbl"]
According to the documentation, when defining an asset key in the
meta
property of a dbt source or model, the
asset_key
should be a list of strings that represents the hierarchical structure of the asset key. The error message suggests that somewhere in the process, a single string is expected instead of a list. To resolve this issue, you should ensure that wherever the
asset_key
is being used or expected, it is being handled as a list of strings. If the
asset_key
is being passed to a function or a part of the system that expects a string, you might need to convert the list into a string representation that matches the expected format. If the error persists, you may want to review the documentation or any schema validation that is applied to the
source.yml
to ensure that the structure of the
asset_key
list is compatible with the expectations of the dbt or Dagster integration. If the documentation does not provide a clear solution, you might need to look into the specific context in which the error is occurring to understand the expected data type and format.
j

Joram Sbrisny

02/28/2024, 2:38 PM
@Scout: can you show me how to fix the issue?
s

Scout

02/28/2024, 2:38 PM
I'm sorry for any confusion, but as a friendly developer relations assistant for Dagster, I don't have the capability to directly fix issues in your code or configuration files. However, I can guide you on how to potentially resolve the issue based on the error message you've provided. The error message indicates that a string was expected, but a list was provided. This suggests that the format of the
asset_key
in your
source.yml
file might not be what the system expects. Typically, an
asset_key
should be a string that uniquely identifies an asset in Dagster. Here's the part of your
source.yml
that seems to be causing the issue:
Copy code
yaml - name: pba_ora_dm_vertrieb_tbl   meta:     dagster:       asset_key: ["leben","ba_provision", "raw_data", "pba_ora_dm_vertrieb_tbl"]
To resolve the issue, you might need to change the list to a string. However, without specific documentation on the expected format for the
asset_key
in your context, I can't provide an exact solution. If the
asset_key
is supposed to be a hierarchical representation, you might need to concatenate the list elements into a single string that represents the hierarchy. For example, if the hierarchy is represented by a dot-separated string, you could change the list to a string like this:
Copy code
yaml - name: pba_ora_dm_vertrieb_tbl   meta:     dagster:       asset_key: "leben.ba_provision.raw_data.pba_ora_dm_vertrieb_tbl"
Please note that this is just an example, and the actual format you need to use may vary based on the requirements of the system you are working with. You should consult the documentation for the correct format of the
asset_key
or reach out to the community or support channels for more specific guidance. If you continue to experience issues, I recommend checking the documentation for the expected format of the
asset_key
or seeking help from the Dagster community or support channels.