Skip to content

Commit

Permalink
dataset crawler filtering not working with [sc-29743]
Browse files Browse the repository at this point in the history
  • Loading branch information
alyiwang committed Nov 6, 2024
1 parent 7d4fce9 commit 6590a04
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 = [

Check warning on line 144 in metaphor/snowflake/extractor.py

View check run for this annotation

Codecov / codecov/patch

metaphor/snowflake/extractor.py#L144

Added line #L144 was not covered by tests
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 = [

Check warning on line 89 in metaphor/snowflake/profile/extractor.py

View check run for this annotation

Codecov / codecov/patch

metaphor/snowflake/profile/extractor.py#L89

Added line #L89 was not covered by tests
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.148"
version = "0.14.149"
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 6590a04

Please sign in to comment.