GeezerVison is showing github.com — datetime property · Issue #50 · googleapis/google-cloud-python
Labels 🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DescriptionI not sure is it is a bug but when I have tried save() a entity with a datetime property appear this error.
pb_attr, pb_value = helpers.get_protobuf_attribute_and_value(value)
File "/usr/local/lib/python2.7/dist-packages/gcloud/datastore/helpers.py", line 39, in get_protobuf_attribute_and_value
name, value = 'timestamp_microseconds', time.mktime(val.timetuple())
NameError: global name 'time' is not defined
Activityadded a commit that references this issue on Feb 25, 2014This issue will close once commit f6979f5 is merged into the 'master' branch.f6979f5 jgeewax commented on Feb 25, 2014 It definitely is a bug -- just a missing import.
I just created a pull request that fixes the import and adds tests so this shouldn't happen again. added a commit that references this issue on Feb 25, 2014This issue will close once commit 2c26d9b is merged into the 'main' branch.2c26d9b albertog commented on Feb 26, 2014 I have tried but seems there are other issue, when saving datat
toy.update({'name': 'Toy', 'some_int_value': 1234, 'fecha': datetime(2014,12,1,23,59,59)})
---- tracer
File "gcloud/datastore/entity.py", line 182, in save
properties=dict(self))
File "gcloud/datastore/connection.py", line 344, in save_entity
setattr(prop.value, pb_attr, pb_value)
File "/usr/local/lib/python2.7/dist-packages/google/protobuf/internal/python_message.py", line 454, in setter
type_checker.CheckValue(new_value)
File "/usr/local/lib/python2.7/dist-packages/google/protobuf/internal/type_checkers.py", line 104, in CheckValue raise TypeError(message)
TypeError: 1417474799.0 has type --type 'float'--,
but expected one of: (--type 'int', --type 'long'--) added 4 commits that reference this issue on Feb 27, 2014This issue will close once commit 85eff05 is merged into the 'master' branch.85eff05 This issue will close once commit d3f5b1b is merged into the 'master' branch.d3f5b1b This issue will close once commit ba56882 is merged into the 'master' branch.ba56882 This issue will close once commit d4d9669 is merged into the 'master' branch.d4d9669 added 3 commits that reference this issue on Mar 8, 2014This issue will close once commit fef9d79 is merged into the 'master' branch.fef9d79 This issue will close once commit 8a0b8cd is merged into the 'master' branch.8a0b8cd This issue will close once commit bc0c1fd is merged into the 'main' branch.bc0c1fd added this to the This milestone has been deleted milestone on Jan 30, 2015added 4 commits that reference this issue on Mar 2, 2026This issue will close once commit a7e26d1 is merged into the 'main' branch.a7e26d1 This issue will close once commit cd4711e is merged into the 'main' branch.cd4711e This issue will close once commit 7b26b4d is merged into the 'main' branch.7b26b4d This issue will close once commit 92357b9 is merged into the 'main' branch.92357b9
MetadataMetadata🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DevelopmentNo branches or pull requestsIssue actions
|