fix
This commit is contained in:
19
streams-events/app/utils.py
Normal file
19
streams-events/app/utils.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import dictdiffer
|
||||
from arnparse import arnparse
|
||||
|
||||
|
||||
def table_from_arn(arn: str) -> str:
|
||||
arn_ = arnparse(arn)
|
||||
return arn_.resource.split('/')[0]
|
||||
|
||||
|
||||
def diff(first: dict, second: dict) -> list[str]:
|
||||
result = dictdiffer.diff(first, second)
|
||||
changed = []
|
||||
|
||||
for record in result:
|
||||
type_, path, _ = record
|
||||
if type_ == 'change':
|
||||
changed.append(path)
|
||||
|
||||
return changed
|
||||
Reference in New Issue
Block a user