python-mock-firestore icon indicating copy to clipboard operation
python-mock-firestore copied to clipboard

document.get() does not support argument 'transactions'

Open agherasim opened this issue 1 year ago • 5 comments

Reference: https://github.com/mdowds/python-mock-firestore/blob/0de34b1c319c08ccbcc6887d110f3bf8f5ff2116/mockfirestore/document.py#L42

While mocking fireo ORM, get queries cannot execute due to missing transactions argument for document.get() method. Google Firestore v1 library provides transactions argument: https://github.com/googleapis/python-firestore/blob/2d42731996586fd63e9b8453b0eb627d3e23a310/google/cloud/firestore_v1/document.py#L362

agherasim avatar Jul 09 '23 22:07 agherasim

Having the same issue. @agherasim your solution works. Should also update get in DocumentReference class as well, if you are planning to use transaction with references.

ignasbol avatar Jul 19 '23 17:07 ignasbol

@ignasbol forgot to merge the changes. I pushed the changes addressing DocumentReference, querying works now as well.

agherasim avatar Jul 21 '23 05:07 agherasim

@mdowds would you be able to review this PR and merge the changes?

agherasim avatar Aug 27 '23 20:08 agherasim

@mdowds Please checkout this PR. I really need this fix to solve this issue in our project.

alexjolig avatar Feb 19 '24 09:02 alexjolig

@alexjolig, this repo seems unmaintained, unfortunately. What I ended up doing was to create a fork of it, fix issues, and use it as a local dependency.

agherasim avatar Mar 04 '24 15:03 agherasim