diff --git a/api/chalicelib/core/alerts/alerts_processor_ch.py b/api/chalicelib/core/alerts/alerts_processor_ch.py index 982518be1..316c0f166 100644 --- a/api/chalicelib/core/alerts/alerts_processor_ch.py +++ b/api/chalicelib/core/alerts/alerts_processor_ch.py @@ -173,7 +173,7 @@ def process(): logger.debug(alert) logger.debug(query) try: - result = ch_cur.execute(query) + result = ch_cur.execute(query=query) if len(result) > 0: result = result[0] diff --git a/api/chalicelib/core/errors/errors_ch.py b/api/chalicelib/core/errors/errors_ch.py index 83954fc16..ba728769f 100644 --- a/api/chalicelib/core/errors/errors_ch.py +++ b/api/chalicelib/core/errors/errors_ch.py @@ -400,7 +400,7 @@ def search(data: schemas.SearchErrorsSchema, project: schemas.ProjectContext, us # print("------------") query = ch.format(query=main_ch_query, parameters=params) - rows = ch.execute(query) + rows = ch.execute(query=query) total = rows[0]["total"] if len(rows) > 0 else 0 for r in rows: diff --git a/api/chalicelib/core/metrics/heatmaps_ch.py b/api/chalicelib/core/metrics/heatmaps_ch.py index cfbd1b89c..3b78ef551 100644 --- a/api/chalicelib/core/metrics/heatmaps_ch.py +++ b/api/chalicelib/core/metrics/heatmaps_ch.py @@ -84,7 +84,7 @@ def get_by_url(project_id, data: schemas.GetHeatMapPayloadSchema): logger.debug(query) logger.debug("---------") try: - rows = cur.execute(query) + rows = cur.execute(query=query) except Exception as err: logger.warning("--------- HEATMAP 2 SEARCH QUERY EXCEPTION CH -----------") logger.warning(query) @@ -122,7 +122,7 @@ def get_x_y_by_url_and_session_id(project_id, session_id, data: schemas.GetHeatM logger.debug(query) logger.debug("---------") try: - rows = cur.execute(query) + rows = cur.execute(query=query) except Exception as err: logger.warning("--------- HEATMAP-session_id SEARCH QUERY EXCEPTION CH -----------") logger.warning(query) @@ -160,7 +160,7 @@ def get_selectors_by_url_and_session_id(project_id, session_id, data: schemas.Ge logger.debug(query) logger.debug("---------") try: - rows = cur.execute(query) + rows = cur.execute(query=query) except Exception as err: logger.warning("--------- HEATMAP-session_id SEARCH QUERY EXCEPTION CH -----------") logger.warning(query) @@ -221,7 +221,7 @@ def __get_1_url(location_condition: schemas.SessionSearchEventSchema2 | None, se logger.debug(main_query) logger.debug("--------------------") try: - url = cur.execute(main_query) + url = cur.execute(query=main_query) except Exception as err: logger.warning("--------- CLICK MAP BEST URL SEARCH QUERY EXCEPTION CH-----------") logger.warning(main_query.decode('UTF-8')) @@ -295,7 +295,7 @@ def search_short_session(data: schemas.HeatMapSessionsSearch, project_id, user_i logger.debug(main_query) logger.debug("--------------------") try: - session = cur.execute(main_query) + session = cur.execute(query=main_query) except Exception as err: logger.warning("--------- CLICK MAP SHORT SESSION SEARCH QUERY EXCEPTION CH -----------") logger.warning(main_query) @@ -342,7 +342,7 @@ def get_selected_session(project_id, session_id): logger.debug(main_query) logger.debug("--------------------") try: - session = cur.execute(main_query) + session = cur.execute(query=main_query) except Exception as err: logger.warning("--------- CLICK MAP GET SELECTED SESSION QUERY EXCEPTION -----------") logger.warning(main_query.decode('UTF-8')) diff --git a/api/chalicelib/core/metrics/modules/significance/significance_ch.py b/api/chalicelib/core/metrics/modules/significance/significance_ch.py index 6d920ce59..f309841c0 100644 --- a/api/chalicelib/core/metrics/modules/significance/significance_ch.py +++ b/api/chalicelib/core/metrics/modules/significance/significance_ch.py @@ -243,7 +243,7 @@ def get_simple_funnel(filter_d: schemas.CardSeriesFilterSchema, project: schemas logger.debug(query) logger.debug("---------------------------------------------------") try: - row = cur.execute(query) + row = cur.execute(query=query) except Exception as err: logger.warning("--------- SIMPLE FUNNEL SEARCH QUERY EXCEPTION CH-----------") logger.warning(query) diff --git a/api/chalicelib/core/sessions/sessions_ch.py b/api/chalicelib/core/sessions/sessions_ch.py index 91fe824c7..4ebc8723d 100644 --- a/api/chalicelib/core/sessions/sessions_ch.py +++ b/api/chalicelib/core/sessions/sessions_ch.py @@ -64,7 +64,7 @@ def search2_series(data: schemas.SessionsSearchPayloadSchema, project_id: int, d logging.debug("--------------------") logging.debug(main_query) logging.debug("--------------------") - sessions = cur.execute(main_query) + sessions = cur.execute(query=main_query) elif metric_type == schemas.MetricType.TABLE: full_args["limit_s"] = 0 @@ -112,7 +112,7 @@ def search2_series(data: schemas.SessionsSearchPayloadSchema, project_id: int, d logging.debug("--------------------") logging.debug(main_query) logging.debug("--------------------") - sessions = cur.execute(main_query) + sessions = cur.execute(query=main_query) # cur.fetchone() count = 0 if len(sessions) > 0: @@ -1505,7 +1505,7 @@ def session_exists(project_id, session_id): AND project_id=%(project_id)s LIMIT 1""", parameters={"project_id": project_id, "session_id": session_id}) - row = cur.execute(query) + row = cur.execute(query=query) return row is not None diff --git a/api/schemas/schemas.py b/api/schemas/schemas.py index 0065836c5..ceee5df7c 100644 --- a/api/schemas/schemas.py +++ b/api/schemas/schemas.py @@ -541,7 +541,7 @@ class RequestGraphqlFilterSchema(BaseModel): @classmethod def _transform_data(cls, values): if values.get("type") in [FetchFilterType.FETCH_DURATION, FetchFilterType.FETCH_STATUS_CODE]: - values["value"] = [int(v) for v in values["value"] if v is not None and v.isnumeric()] + values["value"] = [int(v) for v in values["value"] if v is not None and str(v).isnumeric()] return values