Code Monkey home page Code Monkey logo

Comments (7)

tseaver avatar tseaver commented on August 10, 2024 1

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.

frankyn avatar frankyn commented on August 10, 2024

@IlyaFaer I believe this is complete. I'm closing FR.

If there's something that I missed please reopen.

from python-storage.

IlyaFaer avatar IlyaFaer commented on August 10, 2024

@frankyn, I've delegated the last part to @paul1319
@paul1319, do you have something to push for this issue?

from python-storage.

frankyn avatar frankyn commented on August 10, 2024

Reopening in case there's something pending.

from python-storage.

frankyn avatar frankyn commented on August 10, 2024

@IlyaFaer haven't heard back for a bit. What's remaining?

from python-storage.

paul1319 avatar paul1319 commented on August 10, 2024

@frankyn as I see it, Blob class Refactor and Deprecate part.

from python-storage.

cojenco avatar cojenco commented on August 10, 2024

I believe the refactor is complete through #431 #436 #441 #442 #443 #446

from python-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.