Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow source to be string and enum #259

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion azure/functions/decorators/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/decorators/test_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down