@@ -249,7 +249,7 @@ A first attempt at the routing logic might look similar to the following code sn
249249 try:
250250 route = self.routes[f"{path}-{method}"]
251251 except KeyError:
252- raise RuntimeError(f"Cannot route request to correct method. path={path}, method={method}")
252+ raise RuntimeError(f"Cannot route request to the correct method. path={path}, method={method}")
253253 return route
254254
255255 router = Router()
@@ -402,7 +402,7 @@ The first option could be to use the standard Python Logger, and use a specializ
402402
403403 @app.get("/hello")
404404 def hello():
405- logger.info(f "Request from unknown received")
405+ logger.info("Request from unknown received")
406406 return {"statusCode": 200, "body": json.dumps({"message": "hello unknown!"})}
407407
408408
@@ -476,7 +476,7 @@ As we already have Lambda Powertools as a dependency, we can simply import [Logg
476476
477477 @app.get("/hello")
478478 def hello():
479- logger.info(f "Request from unknown received")
479+ logger.info("Request from unknown received")
480480 return {"statusCode": 200, "body": json.dumps({"message": "hello unknown!"})}
481481
482482
@@ -561,7 +561,7 @@ Let's first explore how we can achieve this with [x-ray SDK](https://docs.aws.am
561561 def hello():
562562 with xray_recorder.in_subsegment("hello") as subsegment:
563563 subsegment.put_annotation("User", "unknown")
564- logger.info(f "Request from unknown received")
564+ logger.info("Request from unknown received")
565565 return {"statusCode": 200, "body": json.dumps({"message": "hello unknown!"})}
566566
567567
@@ -649,7 +649,7 @@ Now, let's try to simplify it with Lambda Powertools:
649649 @tracer.capture_method
650650 def hello():
651651 tracer.put_annotation("User", "unknown")
652- logger.info(f "Request from unknown received")
652+ logger.info("Request from unknown received")
653653 return {"statusCode": 200, "body": json.dumps({"message": "hello unknown!"})}
654654
655655
@@ -738,7 +738,7 @@ Let's expand our application with custom metrics without Powertools to see how i
738738 @tracer.capture_method
739739 def hello():
740740 tracer.put_annotation("User", "unknown")
741- logger.info(f "Request from unknown received")
741+ logger.info("Request from unknown received")
742742 put_metric_data(service=service, method="/hello")
743743 return {"statusCode": 200, "body": json.dumps({"message": "hello unknown!"})}
744744
@@ -823,7 +823,7 @@ To add custom metric in **CloudWatch** we add the `boto3` cloudwatch client. Nex
823823 @tracer.capture_method
824824 def hello():
825825 tracer.put_annotation("User", "unknown")
826- logger.info(f "Request from unknown received")
826+ logger.info("Request from unknown received")
827827 metrics.add_dimension(name="method", value="/hello/<name>")
828828 metrics.add_metric(name="AppMethodsInvocations", unit=MetricUnit.Count, value=1)
829829 return {"statusCode": 200, "body": json.dumps({"message": "hello unknown!"})}
0 commit comments