mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-21 23:58:06 +00:00
fix(ingest/snowflake): Allow SnowflakeObjectAccessEntry.objectId to be None (#7601)
Co-authored-by: Pedro Silva <pedro@acryl.io>
This commit is contained in:
parent
bcda510656
commit
8c1fa04c87
@ -66,8 +66,9 @@ class SnowflakeColumnReference(PermissiveModel):
|
||||
class SnowflakeObjectAccessEntry(PermissiveModel):
|
||||
columns: Optional[List[SnowflakeColumnReference]]
|
||||
objectDomain: str
|
||||
objectId: int
|
||||
objectName: str
|
||||
# Seems like it should never be null, but in practice have seen null objectIds
|
||||
objectId: Optional[int]
|
||||
stageKind: Optional[str]
|
||||
|
||||
|
||||
|
@ -11,6 +11,9 @@ from datahub.ingestion.source.snowflake.constants import (
|
||||
SnowflakeCloudProvider,
|
||||
)
|
||||
from datahub.ingestion.source.snowflake.snowflake_config import SnowflakeV2Config
|
||||
from datahub.ingestion.source.snowflake.snowflake_usage_v2 import (
|
||||
SnowflakeObjectAccessEntry,
|
||||
)
|
||||
from datahub.ingestion.source.snowflake.snowflake_v2 import SnowflakeV2Source
|
||||
|
||||
|
||||
@ -546,3 +549,16 @@ def test_unknown_cloud_region_from_snowflake_region_id():
|
||||
"somecloud_someregion"
|
||||
)
|
||||
assert "Unknown snowflake region" in str(e)
|
||||
|
||||
|
||||
def test_snowflake_object_access_entry_missing_object_id():
|
||||
SnowflakeObjectAccessEntry(
|
||||
**{
|
||||
"columns": [
|
||||
{"columnName": "A"},
|
||||
{"columnName": "B"},
|
||||
],
|
||||
"objectDomain": "View",
|
||||
"objectName": "SOME.OBJECT.NAME",
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user