13
13
14
14
from datahub .configuration .common import AllowDenyPattern
15
15
from datahub .configuration .source_common import DatasetSourceConfigMixin
16
+ from datahub .configuration .validate_field_removal import pydantic_removed_field
16
17
from datahub .emitter .mce_builder import make_group_urn , make_user_urn
17
18
from datahub .emitter .mcp import MetadataChangeProposalWrapper
18
19
from datahub .ingestion .api .common import PipelineContext
51
52
OriginTypeClass ,
52
53
StatusClass ,
53
54
)
55
+ from datahub .utilities .lossy_collections import LossyList
54
56
55
57
logger = logging .getLogger (__name__ )
56
58
@@ -132,11 +134,7 @@ class AzureADConfig(StatefulIngestionConfigBase, DatasetSourceConfigMixin):
132
134
description = "regex patterns for groups to include in ingestion." ,
133
135
)
134
136
135
- # If enabled, report will contain names of filtered users and groups.
136
- filtered_tracking : bool = Field (
137
- default = True ,
138
- description = "If enabled, report will contain names of filtered users and groups." ,
139
- )
137
+ _remove_filtered_tracking = pydantic_removed_field ("filtered_tracking" )
140
138
141
139
# Optional: Whether to mask sensitive information from workunit ID's. On by default.
142
140
mask_group_id : bool = Field (
@@ -156,14 +154,10 @@ class AzureADConfig(StatefulIngestionConfigBase, DatasetSourceConfigMixin):
156
154
157
155
@dataclass
158
156
class AzureADSourceReport (StaleEntityRemovalSourceReport ):
159
- filtered : List [str ] = field (default_factory = list )
160
- filtered_tracking : bool = field (default = True , repr = False )
161
- filtered_count : int = field (default = 0 )
157
+ filtered : LossyList [str ] = field (default_factory = LossyList )
162
158
163
159
def report_filtered (self , name : str ) -> None :
164
- self .filtered_count += 1
165
- if self .filtered_tracking :
166
- self .filtered .append (name )
160
+ self .filtered .append (name )
167
161
168
162
169
163
# Source that extracts Azure AD users, groups and group memberships using Microsoft Graph REST API
@@ -266,9 +260,7 @@ def create(cls, config_dict, ctx):
266
260
def __init__ (self , config : AzureADConfig , ctx : PipelineContext ):
267
261
super ().__init__ (config , ctx )
268
262
self .config = config
269
- self .report = AzureADSourceReport (
270
- filtered_tracking = self .config .filtered_tracking
271
- )
263
+ self .report = AzureADSourceReport ()
272
264
session = requests .Session ()
273
265
retries = Retry (
274
266
total = 5 , backoff_factor = 1 , status_forcelist = [429 , 500 , 502 , 503 , 504 ]
0 commit comments