Comments (7)
ISTM that this effort is not complete: e.g., the client does not have a get_blob
method, nor any of the notification-related methods for buckets.
This partial refactoring complicates the tests a lot -- if it were complete, then bucket / blob unit tests would just use mocked clients and assert that the corresponding method is called correctly, rather than creating mock connections (and real clients, see #416) and grubbing around three layers down.
Basically, any non-client method using the client's _connection
to make API requests should instead be calling a method of the client:
$ git grep api_request google/cloud/storage/{_helpers,blob,bucket,hmac_key,notification}.py
google/cloud/storage/_helpers.py: api_response = client._connection.api_request(
google/cloud/storage/_helpers.py: api_response = client._connection.api_request(
google/cloud/storage/_helpers.py: api_response = client._connection.api_request(
google/cloud/storage/blob.py: client._connection.api_request(
google/cloud/storage/blob.py: info = client._connection.api_request(
google/cloud/storage/blob.py: info = client._connection.api_request(
google/cloud/storage/blob.py: resp = client._connection.api_request(
google/cloud/storage/blob.py: api_response = client._connection.api_request(
google/cloud/storage/blob.py: api_response = client._connection.api_request(
google/cloud/storage/bucket.py: client._connection.api_request(
google/cloud/storage/bucket.py: api_request = functools.partial(
google/cloud/storage/bucket.py: client._connection.api_request, timeout=timeout, retry=retry
google/cloud/storage/bucket.py: api_request=api_request,
google/cloud/storage/bucket.py: client._connection.api_request(
google/cloud/storage/bucket.py: client._connection.api_request(
google/cloud/storage/bucket.py: copy_result = client._connection.api_request(
google/cloud/storage/bucket.py: info = client._connection.api_request(
google/cloud/storage/bucket.py: info = client._connection.api_request(
google/cloud/storage/bucket.py: resp = client._connection.api_request(
google/cloud/storage/bucket.py: api_response = client._connection.api_request(
google/cloud/storage/hmac_key.py: self._client._connection.api_request(
google/cloud/storage/hmac_key.py: self._properties = self._client._connection.api_request(
google/cloud/storage/hmac_key.py: self._properties = self._client._connection.api_request(
google/cloud/storage/hmac_key.py: self._client._connection.api_request(
google/cloud/storage/notification.py: self._properties = client._connection.api_request(
google/cloud/storage/notification.py: client._connection.api_request(
google/cloud/storage/notification.py: response = client._connection.api_request(
google/cloud/storage/notification.py: client._connection.api_request(
from python-storage.
@IlyaFaer I believe this is complete. I'm closing FR.
If there's something that I missed please reopen.
from python-storage.
@frankyn, I've delegated the last part to @paul1319
@paul1319, do you have something to push for this issue?
from python-storage.
Reopening in case there's something pending.
from python-storage.
@IlyaFaer haven't heard back for a bit. What's remaining?
from python-storage.
@frankyn as I see it, Blob class Refactor and Deprecate part.
from python-storage.
I believe the refactor is complete through #431 #436 #441 #442 #443 #446
from python-storage.
Related Issues (20)
- Random "Project was not passed and could not be determined from the environment" HOT 3
- tests.system.test__signing: test_create_signed_resumable_upload_url_v2 failed HOT 1
- tests.system.test__signing: test_create_signed_resumable_upload_url_v4 failed HOT 1
- tests.system.test_blob: test_large_file_write_from_stream failed HOT 1
- tests.system.test_blob: test_large_file_write_from_stream_w_checksum failed HOT 1
- tests.system.test_blob: test_large_file_write_from_stream_w_failed_checksum failed HOT 1
- tests.system.test_blob: test_blob_upload_w_gzip_encoded_download_raw failed HOT 1
- tests.system.test_blob: test_blob_upload_from_file_resumable_with_generation failed HOT 1
- tests.system.test_blob: test_blob_update_storage_class_small_file failed HOT 1
- tests.system.test_blob: test_blob_update_storage_class_large_file failed HOT 1
- tests.system.test_fileio: test_blobwriter_and_blobreader failed HOT 1
- tests.system.test_fileio: test_blobwriter_and_blobreader_text_mode failed HOT 1
- tests.system.test_transfer_manager: test_upload_many_with_threads_and_file_objs failed HOT 1
- tests.system.test_transfer_manager: test_download_chunks_concurrently failed HOT 1
- tests.system.test_transfer_manager: test_upload_chunks_concurrently failed HOT 1
- tests.system.test_transfer_manager: test_upload_chunks_concurrently_with_metadata failed HOT 1
- tests.system.test_transfer_manager: test_upload_chunks_concurrently_with_content_encoding failed HOT 1
- tests.system.test_transfer_manager: test_upload_chunks_concurrently_with_encryption_key failed HOT 1
- Resumable file uploads crashes with 400 error from API HOT 1
- utcnow is deprecated in python3.12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-storage.