Dayten Sheffar
02/14/2023, 10:03 PMairbyte_instance = airbyte_resource.configured(
{
"host": {"env": "AIRBYTE_HOST"},
"port": {"env": "AIRBYTE_PORT"},
"username": {"env": "AIRBYTE_USER"},
"password": {"env": "AIRBYTE_PASSWORD"},
}
)
one_of_many_airbyte_connections = with_resources(
build_airbyte_assets(
connection_id="just_one_of_my_many_connection_ids",
destination_tables=["some_table"],
asset_key_prefix=["custom_asset_key_prefix"]
),
{"airbyte": airbyte_instance}
)
and in my module.py
I have an __init.py__
that is choking on assets=[...]
defs = Definitions(
assets=[one_of_many_airbyte_connections, ...],
...
)
I’m getting the following error:
dagster._check.CheckError: Member of iterable mismatches type. Expected (<class 'dagster._core.definitions.assets.AssetsDefinition'>, <class 'dagster._core.definitions.source_asset.SourceAsset'>, <class 'dagster._core.definitions.cacheable_assets.CacheableAssetsDefinition'>). Got [<dagster._core.definitions.assets.AssetsDefinition object at 0x7f40c1099400>] of type <class 'list'>.
Frankly, not sure how to proceed. All the assets were materializing in a previous structure but we needed a more flexible workspace:
load_from:
# - python_file: mymodule/assets/airbyte_assets.py #OLD
- python_package: mymodule #NEW
Could use some help, not finding what I need in the docs. Thanks!owen
02/14/2023, 10:06 PMwith_resources
(and build_airbyte_assets
) return a List[AssetsDefinition]
so one_of_many_airbyte_connections
is a List[AssetsDefinition]
. So making it a member of the list that you're passing into your defs is nesting it one layer too deepowen
02/14/2023, 10:06 PMdefs = Definitions(
assets=[*one_of_many_airbyte_connections, ...],
...
)
owen
02/14/2023, 10:06 PMDayten Sheffar
02/14/2023, 10:08 PMowen
02/14/2023, 10:08 PM