Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
dont break on debug logs (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakekaplan authored Jul 14, 2023
1 parent 917f452 commit 0458819
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Fixed `S3Bucket.stream_from` path resolution - [#291](https://github.com/PrefectHQ/prefect-aws/pull/291)

### Deprecated

### Removed

## 0.3.5

### Fixed

- Fixed `S3Bucket.stream_from` path resolution - [#291](https://github.com/PrefectHQ/prefect-aws/pull/291)
- Fixed `ECSWorker` debug logs from failing to parse json - [#296](https://github.com/PrefectHQ/prefect-aws/pull/296)

## 0.3.4

Released on June 15th, 2023.
Expand Down
13 changes: 10 additions & 3 deletions prefect_aws/workers/ecs_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,9 @@ def _create_task_and_wait_for_start(
_TASK_DEFINITION_CACHE[flow_run.deployment_id] = task_definition_arn

logger.info(f"Using ECS task definition {task_definition_arn!r}...")
logger.debug(f"Task definition {json.dumps(task_definition, indent=2)}")
logger.debug(
f"Task definition {json.dumps(task_definition, indent=2, default=str)}"
)

# Prepare the task run request
task_run_request = self._prepare_task_run_request(
Expand All @@ -686,7 +688,9 @@ def _create_task_and_wait_for_start(
)

logger.info("Creating ECS task run...")
logger.debug(f"Task run request {json.dumps(task_run_request, indent=2)}")
logger.debug(
f"Task run request {json.dumps(task_run_request, indent=2, default=str)}"
)
try:
task = self._create_task_run(ecs_client, task_run_request)
task_arn = task["taskArn"]
Expand Down Expand Up @@ -861,7 +865,10 @@ def _register_task_definition(
Returns the ARN.
"""
logger.info("Registering ECS task definition...")
logger.debug(f"Task definition request {json.dumps(task_definition, indent=2)}")
logger.debug(
"Task definition request"
f"{json.dumps(task_definition, indent=2, default=str)}"
)
response = ecs_client.register_task_definition(**task_definition)
return response["taskDefinition"]["taskDefinitionArn"]

Expand Down

0 comments on commit 0458819

Please sign in to comment.