Giter Site home page Giter Site logo

Comments (7)

mrocklin avatar mrocklin commented on August 11, 2024

Have you taken a look at the code to S3FileSystem.connect?

    def connect(self, refresh=False):
        """
        Establish S3 connection object.

        Parameters
        ----------
        refresh : bool (True)
            Whether to use cached filelists, if already read
        """
        anon, key, secret, kwargs, ckwargs, token, ssl = \
              (self.anon, self.key, self.secret, self.kwargs,
               self.client_kwargs, self.token, self.use_ssl)

        # Include the current PID in the connection key so that different
        # SSL connections are made for each process.
        tok = tokenize(anon, key, secret, kwargs, ckwargs, token,
                       ssl, os.getpid())
        if refresh:
            self._conn.pop(tok, None)
        logger.debug("Open S3 connection.  Anonymous: %s", self.anon)
        if self.anon:
            # TODO: test addition of kwargs (e.g., S3 data centre)
            from botocore import UNSIGNED
            conf = Config(connect_timeout=self.connect_timeout,
                          read_timeout=self.read_timeout,
                          signature_version=UNSIGNED)
            self.session = boto3.Session(**self.kwargs)
        else:
            conf = Config(connect_timeout=self.connect_timeout,
                          read_timeout=self.read_timeout)
            self.session = boto3.Session(self.key, self.secret, self.token,
                                         **self.kwargs)
        if tok not in self._conn:
            s3 = self.session.client('s3', config=conf, use_ssl=ssl,
                                     **self.client_kwargs)
            self._conn[tok] = s3
        return self._conn[tok]

It might be that what you want to do is pretty doable with modest changes (or perhaps even no changes?) A contribution that allowed this would be very welcome.

from s3fs.

jreback avatar jreback commented on August 11, 2024

#69

this exactly the use case (see the tests for an example)

from s3fs.

jgerardsimcock avatar jgerardsimcock commented on August 11, 2024

I tried that and keep getting the following:

TypeError: __init__() got an unexpected keyword argument 'client_kwargs'

from s3fs.

jreback avatar jreback commented on August 11, 2024

you need to clone and install
this is in master but not released

from s3fs.

jreback avatar jreback commented on August 11, 2024

@martindurant could do a release at some point

from s3fs.

jgerardsimcock avatar jgerardsimcock commented on August 11, 2024

Yes. I went through that as well. In my source code, I have that as an option but still getting this error.

from s3fs.

jgerardsimcock avatar jgerardsimcock commented on August 11, 2024

Thank you. This has been resolved.

from s3fs.

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.