Skip to content

Conversation

@humulla
Copy link
Contributor

@humulla humulla commented Mar 27, 2025

Update property patch script which updated the areaid and patchid in a asset dynamodb record.
All tested and working in staging

other small changes added previously:

  • MakeFile to connect to bonus calc db
  • Script to add dummy data to the housing search index
  • A few changes to the packages in requirements as it wasn't working for me before

@humulla humulla requested a review from a team as a code owner March 27, 2025 11:10
Comment on lines +82 to +85
patchId = patch['id']
areaId = patch['parentId']
asset["patchId"] = patchId if patchId else None
asset["areaId"] = areaId if areaId else None
Copy link
Contributor

@adamtry adamtry Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal but this would be more robust. ".get" returns None if the value isn't found but [] raises an error

asset["patchId"] = patch.get("id")
asset["areaId"] = patch.get("parentId")

OUTPUT_CLASS = Asset
LOGGER = Logger()
STAGE = Stage.HOUSING_STAGING
ITEM_COUNT_LIMIT = 10 # Set to None to return all items
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note you're not using this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants