From 21a701f360cf5d9c214b9fe651d135f84488b810 Mon Sep 17 00:00:00 2001 From: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Date: Sat, 13 Jan 2024 11:49:36 +0530 Subject: [PATCH] Minor: Fix Postgres Cypress Failure (#14698) --- .../metadata/ingestion/source/database/postgres/metadata.py | 4 +--- .../metadata/ingestion/source/database/postgres/queries.py | 2 +- .../main/resources/ui/cypress/e2e/Service/postgres.spec.js | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/database/postgres/metadata.py b/ingestion/src/metadata/ingestion/source/database/postgres/metadata.py index 8fd954de1ec5..20c05cc7a394 100644 --- a/ingestion/src/metadata/ingestion/source/database/postgres/metadata.py +++ b/ingestion/src/metadata/ingestion/source/database/postgres/metadata.py @@ -203,9 +203,7 @@ def get_table_partition_details( self, table_name: str, schema_name: str, inspector ) -> Tuple[bool, TablePartition]: result = self.engine.execute( - POSTGRES_PARTITION_DETAILS.format( - table_name=table_name, schema_name=schema_name - ) + POSTGRES_PARTITION_DETAILS, table_name=table_name, schema_name=schema_name ).all() if result: partition_details = TablePartition( diff --git a/ingestion/src/metadata/ingestion/source/database/postgres/queries.py b/ingestion/src/metadata/ingestion/source/database/postgres/queries.py index 4c8556320de8..a2554a699968 100644 --- a/ingestion/src/metadata/ingestion/source/database/postgres/queries.py +++ b/ingestion/src/metadata/ingestion/source/database/postgres/queries.py @@ -71,7 +71,7 @@ col.table_schema = par.relnamespace::regnamespace::text and col.table_name = par.relname and ordinal_position = pt.column_index - where par.relname='{table_name}' and par.relnamespace::regnamespace::text='{schema_name}' + where par.relname=%(table_name)s and par.relnamespace::regnamespace::text=%(schema_name)s """ ) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/postgres.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/postgres.spec.js index baa8ce25fb52..b4b57780854e 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/postgres.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/postgres.spec.js @@ -37,14 +37,14 @@ const clearQuery = 'select pg_stat_statements_reset()'; const selectQuery = 'SELECT * FROM sales.order_items oi INNER JOIN sales.orders o ON oi.order_id=o.order_id'; -// @ayush - Need to fix postgres ingestion issue -describe.skip('Postgres Ingestion', () => { +describe('Postgres Ingestion', () => { beforeEach(() => { cy.login(); }); it('Trigger select query', () => { cy.postgreSQL(clearQuery); + cy.wait(500); cy.postgreSQL(selectQuery); }); @@ -132,7 +132,7 @@ describe.skip('Postgres Ingestion', () => { cy.get('#root\\/filterCondition') .scrollIntoView() - .type(`s.query like '%%${tableName}%%'`); + .type(`lower(s.query) like '%%${tableName}%%'`); cy.get('[data-testid="submit-btn"]') .scrollIntoView() .should('be.visible')