Skip to content

Commit

Permalink
Add 'licence' column to reporting tables
Browse files Browse the repository at this point in the history
  • Loading branch information
feba-rajan committed Oct 4, 2024
1 parent 332feb1 commit aa80c3d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 4 additions & 2 deletions bin/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
sp.pipeline,
l.endpoint,
e.endpoint_url,
s.licence,
l.status,
l.exception,
l.resource,
Expand All @@ -134,7 +135,7 @@
LEFT JOIN resource r on l.resource = r.resource
GROUP BY
1, 2, 3, 4, 5, 6, 7, 8, 9
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
ORDER BY
s.organisation, o.name, s.collection, sp.pipeline, latest_log_entry_date DESC
Expand All @@ -151,6 +152,7 @@
sp.pipeline,
l.endpoint,
e.endpoint_url,
s.licence,
l.status,
t2.days_since_200,
l.exception,
Expand Down Expand Up @@ -186,7 +188,7 @@
WHERE
e.end_date=''
GROUP BY
1, 2, 3, 4, 5, 6, 7, 8, 9
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
ORDER BY
s.organisation, o.name, s.collection, sp.pipeline, endpoint_entry_date DESC
Expand Down
1 change: 1 addition & 0 deletions bin/load_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def fetch_reporting_data(db_path):
rhe.pipeline,
rhe.endpoint,
rhe.endpoint_url,
rhe.licence,
rhe.resource,
rhe.status,
rhe.exception,
Expand Down
16 changes: 10 additions & 6 deletions bin/load_reporting_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def fetch_historic_endpoints_data_from_dl(db_path):
sp.pipeline,
l.endpoint,
e.endpoint_url,
s.licence,
l.status,
l.exception,
l.resource,
Expand All @@ -43,7 +44,7 @@ def fetch_historic_endpoints_data_from_dl(db_path):
LEFT JOIN resource r on l.resource = r.resource
GROUP BY
1, 2, 3, 4, 5, 6, 7, 8, 9
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
ORDER BY
s.organisation, o.name, s.collection, sp.pipeline, latest_log_entry_date DESC
Expand All @@ -66,6 +67,7 @@ def fetch_latest_endpoints_data_from_dl(db_path):
sp.pipeline,
l.endpoint,
e.endpoint_url,
s.licence,
l.status,
t2.days_since_200,
l.exception,
Expand Down Expand Up @@ -101,7 +103,7 @@ def fetch_latest_endpoints_data_from_dl(db_path):
WHERE
e.end_date=''
GROUP BY
1, 2, 3, 4, 5, 6, 7, 8, 9
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
ORDER BY
s.organisation, o.name, s.collection, sp.pipeline, endpoint_entry_date DESC
Expand All @@ -126,6 +128,7 @@ def create_reporting_tables(historic_endpoints_data, latest_endpoint_data, perfo
pipeline TEXT,
endpoint TEXT,
endpoint_url TEXT,
licence TEXT,
status TEXT,
exception TEXT,
resource TEXT,
Expand All @@ -138,9 +141,9 @@ def create_reporting_tables(historic_endpoints_data, latest_endpoint_data, perfo
""")
cursor.executemany("""
INSERT INTO reporting_historic_endpoints (
organisation, name, collection, pipeline, endpoint, endpoint_url, status, exception, resource,
organisation, name, collection, pipeline, endpoint, endpoint_url, licence, status, exception, resource,
latest_log_entry_date, endpoint_entry_date, endpoint_end_date, resource_start_date, resource_end_date
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""", historic_endpoints_data)

# Create the reporting_latest_endpoints table
Expand All @@ -152,6 +155,7 @@ def create_reporting_tables(historic_endpoints_data, latest_endpoint_data, perfo
pipeline TEXT,
endpoint TEXT,
endpoint_url TEXT,
licence TEXT,
status TEXT,
days_since_200 INTEGER,
exception TEXT,
Expand All @@ -168,9 +172,9 @@ def create_reporting_tables(historic_endpoints_data, latest_endpoint_data, perfo
# Insert data into reporting_latest_endpoints
cursor.executemany("""
INSERT INTO reporting_latest_endpoints (
organisation, name, collection, pipeline, endpoint, endpoint_url, status, days_since_200, exception, resource,
organisation, name, collection, pipeline, endpoint, endpoint_url, licence, status, days_since_200, exception, resource,
latest_log_entry_date, endpoint_entry_date, endpoint_end_date, resource_start_date, resource_end_date, rn
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""", latest_endpoint_data)


Expand Down

0 comments on commit aa80c3d

Please sign in to comment.