# HG changeset patch # User Dennis C. M. # Date 1686404738 -3600 # Node ID ab988fd1e6fafcce3f2d27d850bae62aae7238a7 # Parent d4c4cd4760fa952a6d3b6616bba8f1b0a5f13fab fix minor bugs diff -r d4c4cd4760fa -r ab988fd1e6fa events/get_report_event.json --- a/events/get_report_event.json Thu Jun 08 17:48:52 2023 +0100 +++ b/events/get_report_event.json Sat Jun 10 14:45:38 2023 +0100 @@ -1,7 +1,7 @@ { "queryStringParameters": { - "ticker": "acx", - "type": "pnl", - "year": "2021" + "ticker": "itx", + "type": "balance", + "year": "2023" } } \ No newline at end of file diff -r d4c4cd4760fa -r ab988fd1e6fa events/upload_document_event.json --- a/events/upload_document_event.json Thu Jun 08 17:48:52 2023 +0100 +++ b/events/upload_document_event.json Sat Jun 10 14:45:38 2023 +0100 @@ -2,12 +2,12 @@ "statusCode": 200, "body": { "message": { - "companyTicker": "acx", + "companyTicker": "itx", "docType": "pnl", - "fileId": "decc36fa-540d-40d0-ae50-048cb3270571", - "fileName": "acx_pnl_decc36fa-540d-40d0-ae50-048cb3270571.json", - "objectKey": "processed/acx_pnl_decc36fa-540d-40d0-ae50-048cb3270571.json", - "bucketName": "sandbox-finance-parser-data" + "fileId": "9cb68002-2152-48f0-8ebe-529533f28d8c", + "fileName": "itx_pnl_9cb68002-2152-48f0-8ebe-529533f28d8c.json", + "objectKey": "processed/itx_pnl_9cb68002-2152-48f0-8ebe-529533f28d8c.json", + "bucketName": "finance-parser-data" } } } \ No newline at end of file diff -r d4c4cd4760fa -r ab988fd1e6fa get_tickers/app.py --- a/get_tickers/app.py Thu Jun 08 17:48:52 2023 +0100 +++ b/get_tickers/app.py Sat Jun 10 14:45:38 2023 +0100 @@ -11,6 +11,15 @@ FilterExpression=Key('pk').begins_with('file') ) + results = [] + for item in response['Items']: + item_pk = item['pk'].split('#', 1)[1] + item_year = item['sk'].split('#', 1)[0] + item_key = f'{item_pk}#{item_year}' # pnl#acx#2022 + + if item_key not in results: + results.append(item_key) + return { "statusCode": 200, "headers": { @@ -20,8 +29,8 @@ }, "body": json.dumps({ "message": { - "items": response['Items'], - "count": len(response['Items']) + "items": results, + "count": len(results) } }), }