remove deduplication as default
This commit is contained in:
@@ -23,18 +23,25 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
new_image = event.detail['new_image']
|
||||
metadata = dyn.collection.get_items(
|
||||
TransactKey(new_image['id'])
|
||||
+ SortKey('METADATA#SUBSCRIPTION_COVERED', rename_key='subscription')
|
||||
+ SortKey(
|
||||
'METADATA#SUBSCRIPTION_COVERED',
|
||||
rename_key='subscription',
|
||||
)
|
||||
+ SortKey(
|
||||
'METADATA#DEDUPLICATION_WINDOW',
|
||||
path_spec='offset_days',
|
||||
rename_key='dedup_window_offset_days',
|
||||
)
|
||||
+ SortKey('ORG', rename_key='org'),
|
||||
+ SortKey(
|
||||
'ORG',
|
||||
rename_key='org',
|
||||
),
|
||||
flatten_top=False,
|
||||
)
|
||||
user = User.model_validate(new_image['user'])
|
||||
course = Course.model_validate(new_image['course'])
|
||||
subscription = metadata['subscription'] if 'subscription' in metadata else None
|
||||
offset_days = metadata.get('dedup_window_offset_days', None)
|
||||
enrollment = Enrollment(
|
||||
id=uuid4(),
|
||||
course=course,
|
||||
@@ -45,9 +52,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
enrollment,
|
||||
org=metadata.get('org', None),
|
||||
subscription=subscription,
|
||||
deduplication_window={
|
||||
'offset_days': metadata['dedup_window_offset_days'],
|
||||
},
|
||||
deduplication_window={'offset_days': offset_days} if offset_days else None,
|
||||
linked_entities=frozenset(
|
||||
{
|
||||
LinkedEntity(
|
||||
|
||||
Reference in New Issue
Block a user