Skip to content

Remove static method tag #72

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

Merged
merged 2 commits into from
Mar 13, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def __init__(self, context: str):
self._show_input_query_key: str = "showInput"
self._orchestration_bindings: DurableOrchestrationBindings = \
DurableOrchestrationBindings.from_json(context)
self._post_async_request = lambda u, d: post_async_request(u, d)
self._get_async_request = lambda u: get_async_request(u)
self._delete_async_request = lambda u: delete_async_request(u)
self._post_async_request = post_async_request
self._get_async_request = get_async_request
self._delete_async_request = delete_async_request
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality-wise, this change doesn't change anything, right? I think this is a good change, but just want to make sure I understand if the lambdas had a dependency on the @staticmethod tag

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. The wrappers were a pattern copy from the DurableOrchestrationContext, where there are class level properties being passed into the actual function call. In this context they aren't providing any value.


async def start_new(self,
orchestration_function_name: str,
Expand Down
3 changes: 0 additions & 3 deletions azure/durable_functions/models/utils/http_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import aiohttp


@staticmethod
async def post_async_request(url: str, data: Any = None) -> [int, Any]:
"""Post request with the data provided to the url provided.

Expand All @@ -26,7 +25,6 @@ async def post_async_request(url: str, data: Any = None) -> [int, Any]:
return [response.status, data]


@staticmethod
async def get_async_request(url: str) -> [int, Any]:
"""Get the data from the url provided.

Expand All @@ -46,7 +44,6 @@ async def get_async_request(url: str) -> [int, Any]:
return [response.status, data]


@staticmethod
async def delete_async_request(url: str) -> [int, Any]:
"""Delete the data from the url provided.

Expand Down