Skip to content

Commit

Permalink
dataset crawler filtering not working with [sc-29743] (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
alyiwang authored Nov 6, 2024
1 parent 5d8944e commit a980be2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions metaphor/bigquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ See [Output Config](../common/docs/output.md) for more information.
#### Filtering

See [Filter Config](../common/docs/filter.md) for more information on the optional `filter` config.
> NOTE: While the filter config uses `database -> schema -> table/view` hierarchy, BigQuery uses `project -> database -> table/view` hierarchy. Please use project id at the top level in the include/exclude of the filter config.

#### Tag Assignment

Expand Down
10 changes: 5 additions & 5 deletions metaphor/snowflake/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ async def extract(self) -> Collection[ENTITY_TYPES]:
with self._conn:
cursor = self._conn.cursor()

databases = (
self.fetch_databases(cursor)
if self._filter.includes is None
else list(self._filter.includes.keys())
)
databases = [
db
for db in self.fetch_databases(cursor)
if self._filter.include_database(db)
]
logger.info(f"Databases to include: {databases}")

shared_databases = self._fetch_shared_databases(cursor)
Expand Down
10 changes: 5 additions & 5 deletions metaphor/snowflake/profile/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ async def extract(self) -> Collection[ENTITY_TYPES]:
with self._conn:
cursor = self._conn.cursor()

databases = (
SnowflakeExtractor.fetch_databases(cursor)
if self._filter.includes is None
else list(self._filter.includes.keys())
)
databases = [
db
for db in SnowflakeExtractor.fetch_databases(cursor)
if self._filter.include_database(db)
]

for database in databases:
tables = self._fetch_tables(cursor, database)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "metaphor-connectors"
version = "0.14.150"
version = "0.14.151"
license = "Apache-2.0"
description = "A collection of Python-based 'connectors' that extract metadata from various sources to ingest into the Metaphor app."
authors = ["Metaphor <[email protected]>"]
Expand Down

0 comments on commit a980be2

Please sign in to comment.