Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip projects with no associated order portal ids #47

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions daily_read/ngi_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ def get_data(self, project_id=None, close_date=None):
if close_date is None:
close_date = (datetime.datetime.now() - relativedelta(months=6)).strftime("%Y-%m-%d")
for row in self.statusdb_session.rows(close_date=close_date):
if "portal_id" not in row.value:
# Probably a project with no associated order(e.g legacy ESCG), log it and skip
log.error(f"No portal_id found in row {row.id}, skipping it!")
continue
portal_id = row.value["portal_id"]
order_year = row.value["order_year"]
# Should not happen, upstream manual entry error if it happens
Expand Down
Loading