Skip to content

Commit e448d84

Browse files
Changed sql in postgres_reports.py to lowercase
1 parent f069a2f commit e448d84

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

reporter/postgres_reports.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
class PostgresReportGenerator:
2222
def __init__(self, prometheus_url: str = "http://sink-prometheus:9090",
23-
postgres_sink_url: str = "postgresql://pgwatch:pgwatchadmin@sink-postgres:5432/measurements"):
23+
postgres_sink_url: str = "postgresql://pgwatch@sink-postgres:5432/measurements"):
2424
"""
2525
Initialize the PostgreSQL report generator.
2626
2727
Args:
2828
prometheus_url: URL of the Prometheus instance (default: http://sink-prometheus:9090)
2929
postgres_sink_url: Connection string for the Postgres sink database
30-
(default: postgresql://pgwatch:pgwatchadmin@sink-postgres:5432/measurements)
30+
(default: postgresql://pgwatch@sink-postgres:5432/measurements)
3131
"""
3232
self.prometheus_url = prometheus_url
3333
self.base_url = f"{prometheus_url}/api/v1"
@@ -78,12 +78,12 @@ def get_index_definitions_from_sink(self) -> Dict[str, str]:
7878
with self.pg_conn.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
7979
# Query the index_definitions table for the most recent data
8080
query = """
81-
SELECT DISTINCT ON (data->>'indexrelname')
81+
select distinct on (data->>'indexrelname')
8282
data->>'indexrelname' as indexrelname,
8383
data->>'index_definition' as index_definition
84-
FROM public.index_definitions
85-
WHERE data ? 'indexrelname' AND data ? 'index_definition'
86-
ORDER BY data->>'indexrelname', time DESC
84+
from public.index_definitions
85+
where data ? 'indexrelname' and data ? 'index_definition'
86+
order by data->>'indexrelname', time desc
8787
"""
8888
cursor.execute(query)
8989

0 commit comments

Comments
 (0)