Comments (8)
Hmm, couldn't we do this using by extending the functionality added in #30 ?
from smart_open.
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.
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.
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.
I like the idea. It would be useful for me as well to be able to use proxy
parameter.
from smart_open.
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.
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.
Merged in #38
from smart_open.
Related Issues (20)
- GCS permission denied 'storage.buckets.get' when using 'open' HOT 2
- python 3.11 support?
- Support for type annotations HOT 3
- Suggeted - allowing cache mechanism for files
- Getting OSError in s3 when permission for kms:Decrypt are missing HOT 4
- S3 open fails on files that contain '@' in their path HOT 5
- Writing to FTP fails with error "503 ASCII (Text) data type is not supported for file transfer operations. Please configure your FTP client to use IMAGE (Binary) type and try again" HOT 1
- Test failures with urllib3 2.0.4
- Compatibility issue with soundfile HOT 1
- Add OAuth2 support HOT 1
- pip install for version 3.0.0 failing HOT 14
- Feature request: zstandard compression HOT 1
- Incompatibility with moto 5 HOT 8
- Version 7.0.0 issue - import botocore error HOT 5
- Inconsistent python_requires minimum version HOT 3
- The result of smart_open.open (FileLikeProxy) lacks a __next__-method in 7.0.0 whereas in 6.4.0 (_io.TextIOWrapper) it did HOT 5
- zstd write does not work with `wb` mode
- No way to specify generation when opening a GS blob
- S3 SinglepartWriter writes on exception when garbage collected HOT 2
- [Documentation] `s3` URI example uses `my_key` ambiguously
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 smart_open.