Skip to content

Commit

Permalink
Feature: parameter 'metadata' was missing from create_program
Browse files Browse the repository at this point in the history
  • Loading branch information
MHHukiewitz authored and hoh committed Mar 2, 2023
1 parent 4fd8e7f commit bedffbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/aleph/sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ def create_program(
encoding: Encoding = Encoding.zip,
volumes: Optional[List[Mapping]] = None,
subscriptions: Optional[List[Mapping]] = None,
metadata: Optional[Mapping[str, Any]] = None,
) -> Tuple[ProgramMessage, MessageStatus]:
return self._wrap(
self.async_session.create_program,
Expand All @@ -396,6 +397,7 @@ def create_program(
encoding=encoding,
volumes=volumes,
subscriptions=subscriptions,
metadata=metadata,
)

def forget(
Expand Down Expand Up @@ -1171,6 +1173,7 @@ async def create_program(
encoding: Encoding = Encoding.zip,
volumes: Optional[List[Mapping]] = None,
subscriptions: Optional[List[Mapping]] = None,
metadata: Optional[Mapping[str, Any]] = None,
) -> Tuple[ProgramMessage, MessageStatus]:
"""
Post a (create) PROGRAM message.
Expand Down Expand Up @@ -1244,6 +1247,7 @@ async def create_program(
},
"volumes": volumes,
"time": time.time(),
"metadata": metadata,
}
)

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ async def test_create_program(mock_session_with_post_success):
entrypoint="main:app",
runtime="facefacefacefacefacefacefacefacefacefacefacefacefacefacefaceface",
channel="TEST",
metadata={"tags": ["test"]},
)

assert mock_session_with_post_success.http_session.post.called_once
Expand Down

0 comments on commit bedffbb

Please sign in to comment.