google / google/python-spanner-orm

Fix type annotations for Transaction in model.py.

Open
#118 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
41
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Currently `model.py` uses `google.cloud.spanner_v1.transaction.Transaction` for all the transaction parameters, but I think the read-only methods are designed to work with `google.cloud.spanner_v1.snapshot.Snapshot` too. `Snapshot` is available through the Spanner ORM API in `spanner_orm.api.SpannerReadApi.run_read_only()` and `spanner_orm.decorator.transactional_read()`, so we really should support using correct type annotations for `Snapshot`. Another thing to consider is whether there should be any support for `google.cloud.spanner_v1.batch.Batch` in write-only Model methods.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.