Giter Site home page Giter Site logo

Using a proxy to access S3 about smart_open HOT 8 CLOSED

asieira avatar asieira commented on May 17, 2024
Using a proxy to access S3

from smart_open.

Comments (8)

piskvorky avatar piskvorky commented on May 17, 2024

Hmm, couldn't we do this using by extending the functionality added in #30 ?

from smart_open.

asieira avatar asieira commented on May 17, 2024

Not sure if I understand what you have in mind, but I don't think we can use the same argument here.

On S3OpenWrite, the current usage for **kw is to pass it along to initiate_multipart_upload, not connect_s3: https://github.com/piskvorky/smart_open/blob/master/smart_open/smart_open_lib.py#L402

We could, however, add a new argument to smart_open that is a dict with keyword arguments to be passed along to connect_s3 in a similar way.

from smart_open.

asieira avatar asieira commented on May 17, 2024

Ok, I thought of something simpler and more backwards-compatible. What if smart_open properly handled the case where uri was an instance of boto.s3.key.Key and used its name and bucket properties instead of creating new ones?

This way the calling code would have full control on how it created that Key instance, proxies and all.

from smart_open.

piskvorky avatar piskvorky commented on May 17, 2024

Hmm, interesting idea. As long as it's backward compatible (strings work the same way), we could add support for other types of input, why not.

Any comments @ziky90 @VincTheSecond ?

from smart_open.

ziky90 avatar ziky90 commented on May 17, 2024

I like the idea. It would be useful for me as well to be able to use proxy parameter.

from smart_open.

asieira avatar asieira commented on May 17, 2024

The challenge is that for this to work, I would change the constructors for both S3OpenRead and S3OpenWrite to receive a boto.s3.key.Key instance, which would not be strictly backwards compatible if anyone was using them directly.

from smart_open.

asieira avatar asieira commented on May 17, 2024

I just submitted #38 with a fully functional version of this idea. I'll still need some help fixing one of the tests, which I temporarily commented out.

from smart_open.

tmylk avatar tmylk commented on May 17, 2024

Merged in #38

from smart_open.

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.