-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Pull snippets from docstrings. #2611
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
Conversation
|
@daspecster I have already started a review and noticed a new commit come in. Should I stop reviewing / is it stable? |
|
@dhermes sorry yeah I was getting travis to pass. I updated the PR's original description with a question though.
|
|
#stilltryingtogettravistopass.... |
docs/storage_snippets.py
Outdated
|
|
||
|
|
||
| def _millis(): | ||
| return time.time() * 1000 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
docs/storage_snippets.py
Outdated
| need to be deleted during teardown. | ||
| """ | ||
|
|
||
| import time |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| client = storage.Client(project='my-project') | ||
| bucket = client.get_bucket('my-bucket') | ||
| encryption_key = 'aa426195405adee2c8081bb9e7e74b19' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| print(bucket.get_blob('/path/to/blob.txt')) | ||
| # <Blob: my-bucket, /path/to/blob.txt> | ||
| print(bucket.get_blob('/does-not-exist.txt')) | ||
| # None |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
docs/storage_snippets.py
Outdated
| except AssertionError as e: | ||
| print(' FAIL: %s' % (e,)) | ||
| except Exception as e: # pylint: disable=broad-except | ||
| print(' ERROR: %r' % (e,)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
RE:
Why can't you run these on your local machine? |
|
They passed on my local machine(falsely). I keep having to delete my |
dhermes
left a comment
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.
Ah shucks. Many of those asserts ended up being not so useful, in particular the isinstance ones.
Hold off on this until I get the Pub/Sub rewrite proof-of-concept going?
docs/storage_snippets.py
Outdated
| blob = bucket.get_blob('/remote/path/to/file.txt') | ||
| print(blob.download_as_string()) | ||
|
|
||
| (blob.download_as_string()) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@dhermes am I good to go on this then? |
|
@daspecster Not sure what you are referring to. You should definitely rebase and get the CIs green before merging.. If you are asking about the assets, I said before
|
47b0ec8 to
a589a13
Compare
|
Ok, squashed and we'll see if Travis runs it in a timely fashion. |
a589a13 to
e780cc4
Compare
Pull snippets from docstrings.
These snippets don't run yet but the docs build and pull them.
@dhermes suggested I could merged this in before getting them to run.
I'm not sure about removing the imports for some snippets. It seems like those a nice to have?