Skip to content

Commit 182f663

Browse files
authored
fix: rename wait options model from seconds to wait_seconds (#17)
1 parent ada9368 commit 182f663

6 files changed

Lines changed: 33 additions & 11 deletions

File tree

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*Issue #, if available:*
2+
3+
*Description of changes:*
4+
5+
## Dependencies
6+
If this PR requires testing against a specific branch of the Python Language SDK (e.g., for unreleased changes), uncomment and specify the branch below. Otherwise, leave commented to use the main branch.
7+
8+
<!-- PYTHON_LANGUAGE_SDK_BRANCH: branch-name -->
9+
10+
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77

88
on:
99
push:
10-
10+
branches: [ main ]
1111
pull_request:
1212
branches: [ main ]
1313

@@ -32,6 +32,16 @@ jobs:
3232
- uses: webfactory/ssh-agent@v0.9.1
3333
with:
3434
ssh-private-key: ${{ secrets.SDK_KEY }}
35+
- name: Check for Python Language SDK branch override in PR
36+
if: github.event_name == 'pull_request'
37+
run: |
38+
OVERRIDE=$(echo "${{ github.event.pull_request.body }}" | grep -o 'PYTHON_LANGUAGE_SDK_BRANCH: [^[:space:]]*' | cut -d' ' -f2 || true)
39+
if [ ! -z "$OVERRIDE" ]; then
40+
echo "AWS_DURABLE_SDK_URL=git+ssh://git@github.com/aws/aws-durable-execution-sdk-python.git@$OVERRIDE" >> $GITHUB_ENV
41+
echo "Using Python Language SDK branch override: $OVERRIDE"
42+
else
43+
echo "Using default Python Language SDK (main branch)"
44+
fi
3545
- name: static analysis
3646
run: hatch fmt --check
3747
- name: type checking

src/aws_durable_execution_sdk_python_testing/checkpoint/processors/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _create_wait_details(
127127
else:
128128
scheduled_timestamp = datetime.datetime.now(
129129
tz=datetime.UTC
130-
) + timedelta(seconds=update.wait_options.seconds)
130+
) + timedelta(seconds=update.wait_options.wait_seconds)
131131
return WaitDetails(scheduled_timestamp=scheduled_timestamp)
132132
return None
133133

src/aws_durable_execution_sdk_python_testing/checkpoint/processors/wait.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def process(
3838
"""Process WAIT operation update with scheduler integration for timers."""
3939
match update.action:
4040
case OperationAction.START:
41-
wait_seconds = update.wait_options.seconds if update.wait_options else 0
41+
wait_seconds = (
42+
update.wait_options.wait_seconds if update.wait_options else 0
43+
)
4244
scheduled_timestamp = datetime.now(UTC) + timedelta(
4345
seconds=wait_seconds
4446
)

tests/checkpoint/processors/base_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def test_create_wait_details_with_current_operation():
323323
current_op = Mock()
324324
current_op.wait_details = WaitDetails(scheduled_timestamp=scheduled_time)
325325

326-
wait_options = WaitOptions(seconds=30)
326+
wait_options = WaitOptions(wait_seconds=30)
327327
update = OperationUpdate(
328328
operation_id="test-id",
329329
operation_type=OperationType.WAIT,
@@ -339,7 +339,7 @@ def test_create_wait_details_with_current_operation():
339339

340340
def test_create_wait_details_without_current_operation():
341341
processor = MockProcessor()
342-
wait_options = WaitOptions(seconds=30)
342+
wait_options = WaitOptions(wait_seconds=30)
343343
update = OperationUpdate(
344344
operation_id="test-id",
345345
operation_type=OperationType.WAIT,

tests/checkpoint/processors/wait_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_process_start_action():
5050
notifier = MockNotifier()
5151
execution_arn = "arn:aws:states:us-east-1:123456789012:execution:test"
5252

53-
wait_options = WaitOptions(seconds=30)
53+
wait_options = WaitOptions(wait_seconds=30)
5454
update = OperationUpdate(
5555
operation_id="wait-123",
5656
operation_type=OperationType.WAIT,
@@ -99,7 +99,7 @@ def test_process_start_action_with_zero_seconds():
9999
notifier = MockNotifier()
100100
execution_arn = "arn:aws:states:us-east-1:123456789012:execution:test"
101101

102-
wait_options = WaitOptions(seconds=0)
102+
wait_options = WaitOptions(wait_seconds=0)
103103
update = OperationUpdate(
104104
operation_id="wait-123",
105105
operation_type=OperationType.WAIT,
@@ -122,7 +122,7 @@ def test_process_start_action_with_parent_id():
122122
notifier = MockNotifier()
123123
execution_arn = "arn:aws:states:us-east-1:123456789012:execution:test"
124124

125-
wait_options = WaitOptions(seconds=15)
125+
wait_options = WaitOptions(wait_seconds=15)
126126
update = OperationUpdate(
127127
operation_id="wait-123",
128128
operation_type=OperationType.WAIT,
@@ -142,7 +142,7 @@ def test_process_start_action_with_sub_type():
142142
notifier = MockNotifier()
143143
execution_arn = "arn:aws:states:us-east-1:123456789012:execution:test"
144144

145-
wait_options = WaitOptions(seconds=15)
145+
wait_options = WaitOptions(wait_seconds=15)
146146
update = OperationUpdate(
147147
operation_id="wait-123",
148148
operation_type=OperationType.WAIT,
@@ -257,7 +257,7 @@ def test_wait_details_created_correctly():
257257
notifier = MockNotifier()
258258
execution_arn = "arn:aws:states:us-east-1:123456789012:execution:test"
259259

260-
wait_options = WaitOptions(seconds=60)
260+
wait_options = WaitOptions(wait_seconds=60)
261261
update = OperationUpdate(
262262
operation_id="wait-123",
263263
operation_type=OperationType.WAIT,
@@ -277,7 +277,7 @@ def test_no_completed_or_failed_calls():
277277
notifier = MockNotifier()
278278
execution_arn = "arn:aws:states:us-east-1:123456789012:execution:test"
279279

280-
wait_options = WaitOptions(seconds=30)
280+
wait_options = WaitOptions(wait_seconds=30)
281281
update = OperationUpdate(
282282
operation_id="wait-123",
283283
operation_type=OperationType.WAIT,

0 commit comments

Comments
 (0)