Skip to content

Commit

Permalink
derive storage_kind dynamically from the target specified in the repl…
Browse files Browse the repository at this point in the history
…ication_config
  • Loading branch information
izzye84 committed Jul 16, 2024
1 parent bc9586b commit fe791da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hooli-demo-assets/hooli_demo_assets/assets/sling.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
class CustomSlingTranslator(DagsterSlingTranslator):
def __init__(self, target_prefix="RAW_DATA"):
super().__init__(target_prefix=target_prefix)
self.replication_config = replication_config

def get_group_name(self, stream_definition):
return "RAW_DATA"

def get_tags(self, stream_definition):
return {**StorageKindTagSet(storage_kind="S3")}
# derive storage_kind from the target set in the replication_config
storage_kind = self.replication_config.get("target", "DUCKDB")
if storage_kind.startswith("SNOWFLAKE"):
storage_kind = "SNOWFLAKE"
return {**StorageKindTagSet(storage_kind=storage_kind)}


@sling_assets(
Expand Down

0 comments on commit fe791da

Please sign in to comment.