Skip to content

Commit

Permalink
upgrade: python version (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
sauljabin authored Feb 29, 2024
1 parent ef0b130 commit 4cdb262
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions sdk-python/littlehorse/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ async def _execute_task(self, task: ScheduledTask) -> None:
attempt_number=task.attempt_number,
status=status,
output=output,
log_output=to_variable_value(context.log_output)
if context.log_output
else None,
log_output=(
to_variable_value(context.log_output) if context.log_output else None
),
)

asyncio.create_task(self._report_task(task_result, REPORT_TASK_DEFAULT_RETRIES))
Expand Down
28 changes: 16 additions & 12 deletions sdk-python/littlehorse/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,9 +955,11 @@ def handle_exception(

failure_handler = FailureHandlerDef(
handler_spec_name=thread_name,
any_failure_of_type=FailureHandlerDef.LHFailureType.FAILURE_TYPE_EXCEPTION
if exception_name is None
else None,
any_failure_of_type=(
FailureHandlerDef.LHFailureType.FAILURE_TYPE_EXCEPTION
if exception_name is None
else None
),
specific_failure=exception_name,
)
last_node = self._find_node(node.node_name)
Expand Down Expand Up @@ -1020,9 +1022,9 @@ def fail(
ExitNode(
failure_def=FailureDef(
failure_name=failure_name,
content=to_variable_assignment(output)
if output is not None
else None,
content=(
to_variable_assignment(output) if output is not None else None
),
message=message,
)
),
Expand Down Expand Up @@ -1096,9 +1098,9 @@ def reassign_user_task_on_deadline(

reassign = UTActionTrigger.UTAReassign(
user_id=to_variable_assignment(user_id) if user_id is not None else None,
user_group=to_variable_assignment(user_group)
if user_group is not None
else None,
user_group=(
to_variable_assignment(user_group) if user_group is not None else None
),
)

ut_node: UserTaskNode = typing.cast(UserTaskNode, self._last_node().sub_node)
Expand Down Expand Up @@ -1454,9 +1456,11 @@ def do_if(
Edge(
sink_node_name=end_node_name,
variable_mutations=variables_from_if_block,
condition=last_condition_from_if_block
if last_node_from_if_block.name == start_node.name
else None,
condition=(
last_condition_from_if_block
if last_node_from_if_block.name == start_node.name
else None
),
)
)

Expand Down
Loading

0 comments on commit 4cdb262

Please sign in to comment.