Commit d020a47
authored
Adding datastore Key.(to|from)_legacy_urlsafe. (#3491)
* Adding bare-minimum proto for converting legacy App Engine "Reference" pbs.
* Rough draft of working implementation of datastore Key.(to|from)_legacy_urlsafe.
Needs more tests but wanted to get the PR in front of reviewers ASAP.
* Adding implementation for datastore Key.to_legacy_urlsafe().
Also resolved some lint issues (line too long) and restructured
unit test to be able to re-use "stored" values.
* Adding _onestore_v3_pb2 to ignored files for flake8.
* Addressing @jonparrott feedback.
In particular:
- Just splitting on ~ when cleaning app strings
- Rewording to_legacy_urlsafe() docstring to invoke `ndb.Key(urlsafe=...)`
and to restate the "returns" text
- Removing the _urlsafe_b64(decode|encode) micro-optimizations that
were brought over from the ndb codebase
* Adding test coverage for helpers needed for Key.(to|from)_legacy_urlsafe.
* Adding LICENSE header to hand-written legacy GAE proto.
* Renaming _onestore_v3.proto --> _app_engine_key.proto.1 parent 373ebd3 commit d020a47
6 files changed
Lines changed: 702 additions & 1 deletion
File tree
- packages/google-cloud-datastore
- google/cloud/datastore
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
Lines changed: 184 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments