Skip to content

Commit 1b6067a

Browse files
authored
Merge pull request #62 from digital-land/add_provision_end_date
Adding provision_end_date in provision_summary table
2 parents 96dfdfe + 257c7bc commit 1b6067a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bin/load_performance.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
def fetch_provision_data(db_path):
1919
conn = sqlite3.connect(db_path)
2020
query = """
21-
select p.organisation, o.name as organisation_name, p.cohort, p.dataset,p.provision_reason from provision p
21+
select p.organisation, o.name as organisation_name, p.cohort, p.dataset,p.provision_reason, p.end_date as provision_end_date from provision p
2222
inner join organisation o on o.organisation = p.organisation
2323
order by p.organisation
2424
"""
@@ -131,7 +131,7 @@ def create_performance_tables(merged_data, cf_merged_data, endpoint_summary_data
131131
endpoint_summary_table_name, conn, if_exists='replace', index=False)
132132

133133
# Filter out endpoints with an end date as we don't want to count them in provision summary
134-
final_result = merged_data.groupby(['organisation', 'organisation_name', 'dataset', 'provision_reason']).agg(
134+
final_result = merged_data.groupby(['organisation', 'organisation_name', 'dataset', 'provision_reason', 'provision_end_date']).agg(
135135
active_endpoint_count=pd.NamedAgg(
136136
column='endpoint',
137137
aggfunc=lambda x: x[(merged_data.loc[x.index,

check/performance.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"endpoint_dataset_issue_type_summary": ['organisation', 'organisation_name', 'cohort', 'dataset', 'collection', 'pipeline', 'endpoint', 'endpoint_url', 'resource', 'resource_start_date', 'resource_end_date', 'latest_log_entry_date', 'count_issues', 'date', 'issue_type', 'severity', 'responsibility', 'field'],
1111
"endpoint_dataset_resource_summary": ['organisation', 'organisation_name', 'cohort', 'dataset', 'collection', 'pipeline', 'endpoint', 'endpoint_url', 'resource', 'resource_start_date', 'resource_end_date', 'latest_log_entry_date', 'mapping_field', 'non_mapping_field'],
1212
"endpoint_dataset_summary": ['organisation', 'dataset', 'endpoint', 'endpoint_url', 'documentation_url', 'resource', 'latest_status', 'latest_exception', 'latest_log_entry_date', 'entry_date', 'end_date', 'latest_resource_start_date', 'resource_end_date'],
13-
"provision_summary": ['organisation', 'organisation_name', 'dataset', 'provision_reason', 'active_endpoint_count', 'error_endpoint_count', 'count_issue_error_internal', 'count_issue_error_external', 'count_issue_warning_internal', 'count_issue_warning_external', 'count_issue_notice_internal', 'count_issue_notice_external'],
13+
"provision_summary": ['organisation', 'organisation_name', 'dataset', 'provision_reason', 'provision_end_date', 'active_endpoint_count', 'error_endpoint_count', 'count_issue_error_internal', 'count_issue_error_external', 'count_issue_warning_internal', 'count_issue_warning_external', 'count_issue_notice_internal', 'count_issue_notice_external'],
1414
"reporting_historic_endpoints": ['organisation', 'name', 'organisation_name', 'dataset', 'collection', 'pipeline', 'endpoint', 'endpoint_url', 'documentation_url', 'licence', 'latest_status', 'latest_exception', 'resource', 'latest_log_entry_date', 'endpoint_entry_date', 'endpoint_end_date', 'resource_start_date', 'resource_end_date'],
1515
"reporting_latest_endpoints": ['organisation', 'name', 'organisation_name', 'dataset', 'collection', 'pipeline', 'endpoint', 'endpoint_url', 'licence', 'latest_status', 'days_since_200', 'latest_exception', 'resource', 'latest_log_entry_date', 'endpoint_entry_date', 'endpoint_end_date', 'resource_start_date', 'resource_end_date', 'rn']
1616
}

0 commit comments

Comments
 (0)