Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream breaking when an object is updated then deleted in the same change_stream using LOG_BASED #27

Open
Joseph-A-Pearson opened this issue Nov 1, 2023 · 0 comments · May be fixed by #31
Assignees

Comments

@Joseph-A-Pearson
Copy link

When an object has been updated and then deleted between two change stream accesses, the fullDocument comes through as None, for the ’update event as there is no object to lookup. this causes the setting of the object_id field to fail as python can’t iterate through a null object.

The object:
{'_id': {'_data': '826540D20E000000832B022C0100296E5A1004B1454DE22CBD4CED99EDB1A716A6B5E546645F696400646540D20E7B1D780057B2BEAC0004'}, 'operationType': 'update', 'clusterTime': Timestamp(1698746894, 131), 'fullDocument': None, 'ns': {'db': 'api-services-core', 'coll': 'challenges'}, 'documentKey': {'_id': ObjectId('6540d20e7b1d780057b2beac')}, 'updateDescription': {'updatedFields': {'updatedAt': datetime.datetime(2023, 10, 31, 10, 8, 14, 893000), 'sources.device': {'distance': 0}}, 'removedFields': [], 'truncatedArrays': []}}

and the error:

stderr string_id=tap-mongodb-uk-prod
2023-11-01T09:37:03.589083Z [info     ]     object_id: Optional[ObjectId] = document["_id"] if "_id" in document else None cmd_type=elb consumer=False name=tap-mongodb-uk-prod producer=True stdio=stderr string_id=tap-mongodb-uk-prod
2023-11-01T09:37:03.589213Z [info     ] TypeError: argument of type 'NoneType' is not iterable cmd_type=elb consumer=False name=tap-mongodb-uk-prod producer=True stdio=stderr string_id=tap-mongodb-uk-prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants