Skip to content

Commit

Permalink
fix(ingest): avoid mutable defaults in powerbi dataclass (#8609)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored and yoonhyejin committed Aug 24, 2023
1 parent cc8b007 commit 03ea29c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metadata-ingestion/src/datahub/ingestion/api/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _ensure_not_lazy(self, key: str) -> Union[Type[T], Exception]:
plugin_class = import_path(path)
self.register(key, plugin_class, override=True)
return plugin_class
except (AssertionError, ImportError) as e:
except Exception as e:
self.register_disabled(key, e, override=True)
return e

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import dataclasses
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, List, Optional, Union
Expand Down Expand Up @@ -105,7 +106,7 @@ class Measure:
dataType: str = "measure"
datahubDataType: Union[
BooleanTypeClass, DateTypeClass, NullTypeClass, NumberTypeClass, StringTypeClass
] = NullTypeClass()
] = dataclasses.field(default_factory=NullTypeClass)
description: Optional[str] = None


Expand Down

0 comments on commit 03ea29c

Please sign in to comment.