Skip to content

Commit 80eb46e

Browse files
committed
refactor(iceberg): change to ensure is_profiling_enabled is only called once
1 parent 83c0c4f commit 80eb46e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

metadata-ingestion/src/datahub/ingestion/source/iceberg/iceberg_common.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ class IcebergSourceConfig(StatefulIngestionConfigBase, DatasetSourceConfigMixin)
8585
processing_threads: int = Field(
8686
default=1, description="How many threads will be processing tables"
8787
)
88+
def __init__(self):
89+
self.profiling_enabled = self.profiling.enabled and is_profiling_enabled(
90+
self.profiling.operation_config
91+
)
8892

8993
@validator("catalog", pre=True, always=True)
9094
def handle_deprecated_catalog_format(cls, value):
@@ -126,9 +130,7 @@ def validate_catalog_size(cls, value):
126130
return value
127131

128132
def is_profiling_enabled(self) -> bool:
129-
return self.profiling.enabled and is_profiling_enabled(
130-
self.profiling.operation_config
131-
)
133+
return self.profiling_enabled
132134

133135
def get_catalog(self) -> Catalog:
134136
"""Returns the Iceberg catalog instance as configured by the `catalog` dictionary.

0 commit comments

Comments
 (0)