Skip to content

Conversation

@HemangChothani
Copy link
Collaborator

Fixes [26]

Args:
callback(Callable[[:class:`~google.cloud.firestore.document.DocumentSnapshot`], NoneType]):
callback(Callable[List[:class:`~google.cloud.firestore_v1.document.DocumentSnapshot`], \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space should be added after first callback word

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should i add the space, because i didn't change that thing, i have only added that parameters

def on_snapshot(document_snapshot, changes, read_time):
doc = document_snapshot
print(u'{} => {}'.format(doc.id, doc.to_dict()))
for doc in collection_snapshot.documents:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arg name should be changed as well
image

Args:
callback(Callable[[:class:`~google.cloud.firestore.query.QuerySnapshot`], NoneType]):
callback(Callable[List[:class:`~google.cloud.firestore_v1.query.QuerySnapshot`], \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after callback should be added

def on_snapshot(collection_snapshot, changes, read_time):
for doc in collection_snapshot.documents:
for doc in collection_snapshot:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In here you're deleting documents, but in the next file you're keeping it, though examples looks the same

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This given example is not working , if i remove .documents then it works properly as it gives document_snapshot in return, so once i confirm it,i will changed it.

Comment on lines 516 to 518
def on_snapshot(document_snapshot, changes, read_time):
doc = document_snapshot
print(u'{} => {}'.format(doc.id, doc.to_dict()))
for doc in document_snapshot:
print(u'{} => {}'.format(doc.id, doc.to_dict()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make it consistent with the changes to the collection.py:

            def on_snapshot(docs, changes, read_time):
                for doc in docs:
                    print(u'{} => {}'.format(doc.id, doc.to_dict()))

...or vice versa.

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 this pull request may close these issues.

4 participants