-
Notifications
You must be signed in to change notification settings - Fork 28
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
docs: Docstrings for django_spanner
#564
Conversation
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks like a clear improvement (aside from the odd unicode chars), any reason it's still in draft?
django_spanner/schema.py
Outdated
@@ -123,6 +130,13 @@ def create_model(self, model): | |||
self.create_model(field.remote_field.through) | |||
|
|||
def delete_model(self, model): | |||
""" | |||
Drop the model’s table in the database along with any unique constraints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is a unicode RIGHT SINGLE QUOTATION MARK, did you write these docstrings in a rich text editor first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it.
I guess there is no such reason for now, I've fixed the rest changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the TODOs.
django_spanner/client.py
Outdated
def runshell(self, parameters): | ||
"""Override the base class method. | ||
|
||
TODO: Consider actual implementation of this method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear that we could implement this since cloud spanner doesn't have a "shell" executable. We might want to consider https://github.com/cloudspannerecosystem/spanner-cli or a similar project for this in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the docstring here, just raising NotSupportedError
is fine since spanner doesn't really give us a way to support this.
django_spanner/operations.py
Outdated
Transform a time value to an object compatible with what is expected | ||
by the backend driver for time columns. | ||
|
||
:type value: #TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there are still a lot of TODOs in the docstrings in this file.
django_spanner/operations.py
Outdated
# TODO: here and below, remove unused expression and connection parameters | ||
# or include them to the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mf2199 I moved this comment in d36b9ab since the preceding change had this comment in each of the converter docstrings:
#TODO remove unused expression and connection parameters or include them to the code.
But converters are part of the django db API, and we can't change the signature without also replacing django internals. See e.g. https://github.com/django/django/blob/8093aaa8ff9dd7386a069c6eb49fcc1c5980c033/django/db/models/sql/compiler.py#L1084.
django_spanner/operations.py
Outdated
def convert_binaryfield_value(self, value, expression, connection): | ||
"""Convert a binary field to Cloud Spanner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT these docstrings are backwards: value
comes from python-spanner, and we're converting from one bytes
(or "bytes-like object") it into another: from a base64-encoded bytes
returned by spanner to a non-base64-encoded bytes
for django, since that's the internal type for django BinaryField
s.
django_spanner/operations.py
Outdated
"""Convert a date and time field to Cloud Spanner. | ||
|
||
:type value: #TODO | ||
:param value: A binary field value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/paste?
No description provided.