mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 18:07:57 +00:00
fix(ingest/bigquery): Fix BigQueryTableType enum accesses (#7685)
This commit is contained in:
parent
c8abf9a1d4
commit
419bee8614
@ -2,7 +2,6 @@ import logging
|
||||
from collections import defaultdict
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime, timezone
|
||||
from enum import Enum
|
||||
from typing import Any, Dict, List, Optional, cast
|
||||
|
||||
from google.cloud import bigquery
|
||||
@ -19,7 +18,7 @@ from datahub.ingestion.source.sql.sql_generic import BaseColumn, BaseTable, Base
|
||||
logger: logging.Logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class BigqueryTableType(Enum):
|
||||
class BigqueryTableType:
|
||||
# See https://cloud.google.com/bigquery/docs/information-schema-tables#schema
|
||||
BASE_TABLE = "BASE TABLE"
|
||||
EXTERNAL = "EXTERNAL"
|
||||
|
||||
@ -18,7 +18,6 @@ from datahub.ingestion.source.bigquery_v2.bigquery_config import BigQueryV2Confi
|
||||
from datahub.ingestion.source.bigquery_v2.bigquery_schema import (
|
||||
BigQueryDataDictionary,
|
||||
BigqueryProject,
|
||||
BigqueryTableType,
|
||||
BigqueryView,
|
||||
)
|
||||
from datahub.ingestion.source.bigquery_v2.lineage import LineageEdge
|
||||
@ -464,7 +463,7 @@ def test_get_views_for_dataset(
|
||||
last_altered=bigquery_view_1.last_altered,
|
||||
comment=bigquery_view_1.comment,
|
||||
view_definition=bigquery_view_1.view_definition,
|
||||
table_type=BigqueryTableType.VIEW,
|
||||
table_type="VIEW",
|
||||
)
|
||||
)
|
||||
row2 = create_row( # Materialized view, no last_altered
|
||||
@ -473,7 +472,7 @@ def test_get_views_for_dataset(
|
||||
created=bigquery_view_2.created,
|
||||
comment=bigquery_view_2.comment,
|
||||
view_definition=bigquery_view_2.view_definition,
|
||||
table_type=BigqueryTableType.MATERIALIZED_VIEW,
|
||||
table_type="MATERIALIZED VIEW",
|
||||
)
|
||||
)
|
||||
query_mock.return_value = [row1, row2]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user