diff --git a/README.md b/README.md index 90d313fe..06d7e0c0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ |Branch|Status| |---|---| -|master|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions%20Python/_apis/build/status/Azure%20Functions%20Durable%20Python?branchName=master)](https://azfunc.visualstudio.com/Azure%20Functions%20Python/_build/latest?definitionId=44&branchName=master)| +|main|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions%20Python/_apis/build/status/Azure%20Functions%20Durable%20Python?branchName=main)](https://azfunc.visualstudio.com/Azure%20Functions%20Python/_build/latest?definitionId=44&branchName=main)| |dev|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions%20Python/_apis/build/status/Azure%20Functions%20Durable%20Python?branchName=dev)](https://azfunc.visualstudio.com/Azure%20Functions%20Python/_build/latest?definitionId=44&branchName=dev)| # Durable Functions for Python diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4324127d..f14b4593 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,7 +6,7 @@ trigger: branches: include: - - master + - main - dev tags: include: diff --git a/azure/durable_functions/entity.py b/azure/durable_functions/entity.py index 3c278ff6..c025085d 100644 --- a/azure/durable_functions/entity.py +++ b/azure/durable_functions/entity.py @@ -3,9 +3,13 @@ from datetime import datetime from typing import Callable, Any, List, Dict + class InternalEntityException(Exception): + """Framework-internal Exception class (for internal use only).""" + pass + class Entity: """Durable Entity Class. @@ -51,7 +55,9 @@ def handle(self, context: DurableEntityContext, batch: List[Dict[str, Any]]) -> # populate context operation = operation_data["name"] if operation is None: - raise InternalEntityException("Durable Functions Internal Error: Entity operation was missing a name field") + message = "Durable Functions Internal Error:"\ + "Entity operation was missing a name field" + raise InternalEntityException(message) context._operation = operation context._input = operation_data["input"] self.fn(context) diff --git a/azure/durable_functions/models/DurableEntityContext.py b/azure/durable_functions/models/DurableEntityContext.py index cc1d9814..37cc980c 100644 --- a/azure/durable_functions/models/DurableEntityContext.py +++ b/azure/durable_functions/models/DurableEntityContext.py @@ -179,7 +179,8 @@ def destruct_on_exit(self) -> None: self._exists = False self._state = None -def from_json_util(self, json_str: str) -> Any: + +def from_json_util(json_str: str) -> Any: """Load an arbitrary datatype from its JSON representation. The Out-of-proc SDK has a special JSON encoding strategy diff --git a/azure/durable_functions/tasks/task_utilities.py b/azure/durable_functions/tasks/task_utilities.py index 4487ea25..cfe8bc2c 100644 --- a/azure/durable_functions/tasks/task_utilities.py +++ b/azure/durable_functions/tasks/task_utilities.py @@ -1,7 +1,7 @@ import json from ..models.history import HistoryEventType, HistoryEvent from azure.functions._durable_functions import _deserialize_custom_object -from datetime import datetime +from dateutil import parser from typing import List, Optional, Dict, Any from ..models.actions.Action import Action from ..models.Task import Task