Skip to content

Commit 48b6581

Browse files
fix(ingest/superset): fixed iterate over int error for building urns (datahub-project#12807)
Co-authored-by: Sergio Gómez Villamor <[email protected]>
1 parent c8347a7 commit 48b6581

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

metadata-ingestion/src/datahub/ingestion/source/superset.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def construct_dashboard_from_api_data(
384384
) -> DashboardSnapshot:
385385
dashboard_urn = make_dashboard_urn(
386386
platform=self.platform,
387-
name=dashboard_data["id"],
387+
name=str(dashboard_data["id"]),
388388
platform_instance=self.config.platform_instance,
389389
)
390390
dashboard_snapshot = DashboardSnapshot(
@@ -416,7 +416,7 @@ def construct_dashboard_from_api_data(
416416
chart_urns.append(
417417
make_chart_urn(
418418
platform=self.platform,
419-
name=value.get("meta", {}).get("chartId", "unknown"),
419+
name=str(value.get("meta", {}).get("chartId", "unknown")),
420420
platform_instance=self.config.platform_instance,
421421
)
422422
)
@@ -499,7 +499,7 @@ def emit_dashboard_mces(self) -> Iterable[MetadataWorkUnit]:
499499
def construct_chart_from_chart_data(self, chart_data: dict) -> ChartSnapshot:
500500
chart_urn = make_chart_urn(
501501
platform=self.platform,
502-
name=chart_data["id"],
502+
name=str(chart_data["id"]),
503503
platform_instance=self.config.platform_instance,
504504
)
505505
chart_snapshot = ChartSnapshot(

metadata-ingestion/tests/integration/superset/test_superset.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
3535
"count": 2,
3636
"result": [
3737
{
38-
"id": "1",
38+
"id": 1,
3939
"changed_by": {
4040
"first_name": "Test",
4141
"id": 1,
@@ -63,7 +63,7 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
6363
"certification_details": "Approved",
6464
},
6565
{
66-
"id": "2",
66+
"id": 2,
6767
"changed_by": {
6868
"first_name": "Test",
6969
"id": 2,
@@ -95,7 +95,7 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
9595
"count": 4,
9696
"result": [
9797
{
98-
"id": "10",
98+
"id": 10,
9999
"changed_by": {
100100
"first_name": "Test",
101101
"id": 1,
@@ -109,7 +109,7 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
109109
"params": '{"metrics": [], "adhoc_filters": []}',
110110
},
111111
{
112-
"id": "11",
112+
"id": 11,
113113
"changed_by": {
114114
"first_name": "Test",
115115
"id": 1,
@@ -123,7 +123,7 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
123123
"params": '{"metrics": [], "adhoc_filters": []}',
124124
},
125125
{
126-
"id": "12",
126+
"id": 12,
127127
"changed_by": {
128128
"first_name": "Test",
129129
"id": 2,
@@ -137,7 +137,7 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
137137
"params": '{"metrics": [], "adhoc_filters": []}',
138138
},
139139
{
140-
"id": "13",
140+
"id": 13,
141141
"changed_by": {
142142
"first_name": "Test",
143143
"id": 2,
@@ -393,7 +393,7 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
393393
"schema": "test_schema_name",
394394
"table_name": "test_table_name",
395395
"database": {
396-
"id": "30",
396+
"id": 30,
397397
"database_name": "test_database_name",
398398
},
399399
},
@@ -576,7 +576,7 @@ def test_superset_stateful_ingest(
576576
"count": 1,
577577
"result": [
578578
{
579-
"id": "1",
579+
"id": 1,
580580
"changed_by": {
581581
"first_name": "Test",
582582
"id": 1,
@@ -613,7 +613,7 @@ def test_superset_stateful_ingest(
613613
"count": 3,
614614
"result": [
615615
{
616-
"id": "10",
616+
"id": 10,
617617
"changed_by": {
618618
"first_name": "Test",
619619
"id": 1,
@@ -627,7 +627,7 @@ def test_superset_stateful_ingest(
627627
"params": '{"metrics": [], "adhoc_filters": []}',
628628
},
629629
{
630-
"id": "11",
630+
"id": 11,
631631
"changed_by": {
632632
"first_name": "Test",
633633
"id": 1,
@@ -641,7 +641,7 @@ def test_superset_stateful_ingest(
641641
"params": '{"metrics": [], "adhoc_filters": []}',
642642
},
643643
{
644-
"id": "12",
644+
"id": 12,
645645
"changed_by": {
646646
"first_name": "Test",
647647
"id": 2,

0 commit comments

Comments
 (0)