Skip to content

Commit

Permalink
fix: format the billing tag extract JSON (#320)
Browse files Browse the repository at this point in the history
Update the Lamda function so that the output JSON is formatted.  This is
needed to allow the Glue Crawler to properly detected the object fields.
  • Loading branch information
patheard authored Nov 12, 2024
1 parent 9ac67f2 commit b7f5770
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ def handler(event, context):

# .write json to string and add a newline between each record
logging.info("Writing account tags to json")
accounts = json.dumps(accounts, default=str)
accounts = accounts.replace("}, ", "},\n")
accounts = accounts.replace("[{", "[\n{")
accounts = json.dumps(accounts, default=str, indent=2)
logging.info(f"Accounts: {accounts}")

# save accounts to an s3 bucket
Expand Down

0 comments on commit b7f5770

Please sign in to comment.