From 630604bc6b80e39f286d2837d68cee40e38cb31a Mon Sep 17 00:00:00 2001 From: Mike Schiller Date: Tue, 14 Nov 2017 00:05:22 -0500 Subject: [PATCH] adding support for getting list of foreign tables for PostgreSQL (#3856) * adding support for getting list of foreign tables for PostgreSQL * need extra newline to pass lint --- superset/db_engine_specs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index 136b6594a2..562f35993a 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -238,6 +238,13 @@ class PostgresEngineSpec(BaseEngineSpec): def convert_dttm(cls, target_type, dttm): return "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S')) + @classmethod + def get_table_names(cls, schema, inspector): + """Need to consider foreign tables for PostgreSQL""" + tables = inspector.get_table_names(schema) + tables.extend(inspector.get_foreign_table_names(schema)) + return sorted(tables) + class Db2EngineSpec(BaseEngineSpec): engine = 'ibm_db_sa'