googleapis / googleapis/google-cloud-python

Support UTF-8 data in `JsonProperty`

オープン
#15,830 コメント 1 件 リアクション 0 件 担当者 1 名 @daniel-sanche が担当を希望しています GitHub で見る
api: datastore priority: p3 type: feature request
主要言語
Python
スター
5.4k
フォーク
1.8k
平均マージ
3日 4時間
マージ済み PR(30日)
122

説明

We have datastore entities with a property that holds JSON data. The entities itself were written using a datastore library in a different language than Python. The data includes unescaped UTF-8 characters (which should be legal in JSON, and is generally well supported).

When using an NDB `JsonProperty` to access this data from within Python, however, this breaks. This is because `JsonProperty` only supports ascii data:

```python
def _from_base_type(self, value):
if not isinstance(value, str):
value = value.decode("ascii")
return json.loads(value)
```

Could `JsonProperty` be adapted to decode `utf-8`, to have better interoperability between different languages working on the same data?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。