google / google/python-spanner-orm

Support for COMMIT_TIMESTAMP

未关闭
#77 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
41
派生
17
PR 合并指标
30 天内没有已合并 PR

描述

`spanner.COMMIT_TIMESTAMP` is a special value that may be used for automatically setting timestamp fields using commit time. However, the ORM doesn't support this:
```
/usr/local/lib/python3.7/site-packages/spanner_orm/model.py in __init__(self, values, persisted)
462
463 for column in self._columns:
--> 464 self._metaclass.validate_value(column, values.get(column), ValueError)
465
466 for column in self._columns:

/usr/local/lib/python3.7/site-packages/spanner_orm/model.py in validate_value(cls, field_name, value, error_type)
125 cls.fields[field_name].validate(value)
126 except error.ValidationError as ex:
--> 127 raise error_type(*ex.args)
128
129

ValueError: spanner.commit_timestamp() is not of type datetime
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。