Skip to content

Streamline schema name ignore for 'information_schema' #6

Description

@aaronsteers

Proposal would be to add something like excluded_schema_names to streamline the operation below, which excludes information_schema from catalog generation:

# overridden to filter out the information_schema from catalog discovery
def discover_catalog_entries(self) -> list[dict]:
"""Return a list of catalog entries from discovery.
Returns:
The discovered catalog entries as a list.
"""
result: list[dict] = []
engine = self.create_sqlalchemy_engine()
inspected = sqlalchemy.inspect(engine)
schema_names = [
schema_name
for schema_name in self.get_schema_names(engine, inspected)
if schema_name.lower() != "information_schema"
]
for schema_name in schema_names:
# Iterate through each table and view
for table_name, is_view in self.get_object_names(
engine, inspected, schema_name
):
catalog_entry = self.discover_catalog_entry(
engine, inspected, schema_name, table_name, is_view
)
result.append(catalog_entry.to_dict())
return result

Should probably be an SDK feature so that target developers can more easily implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions