From 95dfc913ed509b2a6f9953129b3190e986486d2d Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Wed, 9 Oct 2024 10:51:49 -0500 Subject: [PATCH] cherry pick changes --- azure/functions/decorators/blob.py | 5 ++++- tests/decorators/test_blob.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/azure/functions/decorators/blob.py b/azure/functions/decorators/blob.py index bd2861fa..9ed4ce2f 100644 --- a/azure/functions/decorators/blob.py +++ b/azure/functions/decorators/blob.py @@ -17,7 +17,10 @@ def __init__(self, **kwargs): self.path = path self.connection = connection - self.source = source.value if source else None + if isinstance(source, BlobSource): + self.source = source.value + else: + self.source = source # type: ignore super().__init__(name=name, data_type=data_type) @staticmethod diff --git a/tests/decorators/test_blob.py b/tests/decorators/test_blob.py index 43926591..bad8f99b 100644 --- a/tests/decorators/test_blob.py +++ b/tests/decorators/test_blob.py @@ -50,7 +50,7 @@ def test_blob_trigger_creation_with_source_as_string(self): trigger = BlobTrigger(name="req", path="dummy_path", connection="dummy_connection", - source=BlobSource.EVENT_GRID, + source="EventGrid", data_type=DataType.UNDEFINED, dummy_field="dummy")