From 35ca60cb4454ef5acbeb456ae1336e7305612505 Mon Sep 17 00:00:00 2001 From: Andrew Ardill Date: Tue, 7 Jan 2025 02:15:18 +1100 Subject: [PATCH] [embedded-elt][sling] Correctly get an object_key when a stream has an empty config (#26797) ## Summary & Motivation This fixes an issue where Sling materialisations fail if a stream has an empty config. A fix for #25515 and #25925 Original code by @Westm7 ## How I Tested These Changes I had a failing config, which no longer fails after this change. Co-authored-by: Westm7 --- .../dagster_embedded_elt/sling/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_modules/libraries/dagster-embedded-elt/dagster_embedded_elt/sling/resources.py b/python_modules/libraries/dagster-embedded-elt/dagster_embedded_elt/sling/resources.py index c0d57e6e643ea..d52cf19fffb03 100644 --- a/python_modules/libraries/dagster-embedded-elt/dagster_embedded_elt/sling/resources.py +++ b/python_modules/libraries/dagster-embedded-elt/dagster_embedded_elt/sling/resources.py @@ -403,7 +403,7 @@ def _replicate( for stream in stream_definitions: asset_key = dagster_sling_translator.get_asset_key(stream) - object_key = stream.get("config", {}).get("object") + object_key = (stream.get("config") or {}).get("object") destination_stream_name = object_key or stream["name"] table_name = None if destination_name and destination_stream_name: