Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTimeProperty auto_now* is not set for StructuredProperty and LocalStructuredProperty #216

Closed
chmoder opened this issue Oct 7, 2019 · 0 comments · Fixed by #221
Closed
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@chmoder
Copy link
Contributor

chmoder commented Oct 7, 2019

  1. OS X
  2. Python 3.7.3
  3. $ pip show google-cloud-ndb
    Name: google-cloud-ndb
    Version: 0.1.0
    Summary: NDB library for Google Cloud Datastore
    Home-page: https://github.com/googleapis/python-ndb
    Author: Google LLC
    Author-email: googleapis-packages@google.com
    License: Apache 2.0
    Location: /Users/tcross/development/virtual-environments/csgapi37/lib/python3.7/site-packages
    Requires: google-cloud-datastore, redis

Steps to reproduce

  1. Create a Model with a DateTimeProperty with auto_now_add=True, use that model in another model as a StructuredProperty or LocalStructuredProperty. Create an instance of the model that has the StructuredProperty and then save it. The StructuredProperties entities DateTimeProperty will have a value of None instead of a date time.

Code example

Foo(ndb.Model):
    dtp = ndb.DateTimeProperty(auto_now_add=True)

Bar(ndb.Model):
    foo = ndb.StructuredProperty(Foo)

bar = Bar()
bar.foo = Foo()
bar.put()

Stack trace

N/A
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Oct 8, 2019
@chmoder chmoder changed the title StructuredProperty and LocalStructuredProperty do not set DateTimeProperty auto_now* DateTimeProperty auto_now* is not set for StructuredProperty and LocalStructuredProperty Oct 8, 2019
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Oct 12, 2019
@chrisrossi chrisrossi added 🚨 This issue needs some love. and removed 🚨 🚨 This issue needs some love. triage me I really want to be triaged. labels Oct 14, 2019
chrisrossi pushed a commit that referenced this issue Oct 17, 2019
…turedProperty`. (#221)

This was in the original code, but was overlooked when porting. Fixes #216.
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants