From a67a3241e7d670d134cadddea874e281e731fa20 Mon Sep 17 00:00:00 2001 From: harshsoni2024 <64592571+harshsoni2024@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:39:05 +0530 Subject: [PATCH] sql query correct wildcard syntax (#17405) --- .../metadata/ingestion/source/database/postgres/usage.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ingestion/src/metadata/ingestion/source/database/postgres/usage.py b/ingestion/src/metadata/ingestion/source/database/postgres/usage.py index d6603b5a489..17a7d5962e6 100644 --- a/ingestion/src/metadata/ingestion/source/database/postgres/usage.py +++ b/ingestion/src/metadata/ingestion/source/database/postgres/usage.py @@ -73,3 +73,9 @@ class PostgresUsageSource(PostgresQueryParserSource, UsageSource): ) logger.error(f"Source usage processing error - {err}") logger.debug(traceback.format_exc()) + + def get_filters(self) -> str: + if filter_condition := self.source_config.filterCondition: + filter_condition = filter_condition.replace("%", "%%") + return f"{self.filters} AND s.{filter_condition}" + return self.filters