Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

refactor: move methods to client class - #311

Merged
gcf-merge-on-green[bot] merged 7 commits into
googleapis:masterfrom
MaxxleLLC:storage_issue_38
Dec 11, 2020
Merged

refactor: move methods to client class#311
gcf-merge-on-green[bot] merged 7 commits into
googleapis:masterfrom
MaxxleLLC:storage_issue_38

Conversation

@HemangChothani

Copy link
Copy Markdown
Contributor

Fixes#38

@google-clagoogle-claBot added the cla: yes This human has signed the Contributor License Agreement. label Nov 12, 2020
@HemangChothaniHemangChothani changed the title Storage issue 38refactor: move methods to clisnt classNov 12, 2020
@product-auto-labelproduct-auto-labelBot added the api: storage Issues related to the googleapis/python-storage API. label Nov 12, 2020
@HemangChothaniHemangChothani changed the title refactor: move methods to clisnt classrefactor: move methods to client classNov 12, 2020

@andrewsgandrewsg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewsg

Copy link
Copy Markdown
Contributor

@tswast In the bug you said, "we need to update samples for moved methods before deprecating the old ones." Is this change okay as-is, or do we need to make this change without the deprecation warning first, then update samples, then add the deprecation warning?

@tswast

Copy link
Copy Markdown
Contributor

If it helps you find the samples that need to be updated, I'm okay merging this PR first. It's just a bad look if we have samples on cloud.google.com that show deprecation warnings.

@andrewsg

Copy link
Copy Markdown
Contributor

I agree. But we can't update the sample without pushing part of this change, so @HemangChothani Let's omit the deprecation warning for now and open an issue to update the samples, then add the deprecation warning in that order.

@HemangChothani

Copy link
Copy Markdown
ContributorAuthor

@andrewsg Opend an issue GoogleCloudPlatform/python-docs-samples#5031 to update the samples.

@andrewsgandrewsg added the automerge Merge the pull request once unit tests and other checks pass. label Dec 11, 2020
@gcf-merge-on-green
gcf-merge-on-greenBot merged commit 5b4568e into googleapis:masterDec 11, 2020
@gcf-merge-on-greengcf-merge-on-greenBot removed the automerge Merge the pull request once unit tests and other checks pass. label Dec 11, 2020
@HemangChothani

Copy link
Copy Markdown
ContributorAuthor

@andrewsg I have opend an issue to update sample GoogleCloudPlatform/python-docs-samples#5031 in python-docs-sample repo , but i didn't find any sample needs to update, should i open issue in python-storage repo to update snippets and system-tests for list_blobs and download_to_file methods

@frankyn

Copy link
Copy Markdown
Contributor

@andrewsg and @HemangChothani, I replied to the issue. We are only missing updates for download_to_filename.

@HemangChothani

Copy link
Copy Markdown
ContributorAuthor

@frankyn we have moved download_to_file into the client class, download_to_filename is still in the blob class so i think there is no need to update any sample.

blob.download_to_filename is calling blob.download_to_file method which is deprecated now, so i will update soon and direct call the method client.download_to_file method.

Also update the method call from bucket.list_blobs to client.list_blobs.

@frankyn

Copy link
Copy Markdown
Contributor

Why was only download_to_file updated but not download_to_filename?

@HemangChothani

Copy link
Copy Markdown
ContributorAuthor

Document mentioned in issue #38, found download_to_file and list_blobs methods need to move implementation from blob class to client class and deprecate older one.

cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: storageIssues related to the googleapis/python-storage API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: move API-methods to client

4 participants

@HemangChothani@andrewsg@tswast@frankyn