-
Notifications
You must be signed in to change notification settings - Fork 345
Add region, extra_headers and extra_query_params #1505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add region, extra_headers and extra_query_params #1505
Conversation
d1f7ade
to
32797f3
Compare
32797f3
to
6756df1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated method definitions have not been reflected in the sample provided in api.py, documentation, and examples. It has to be fixed.
@@ -136,6 +143,7 @@ class Minio: | |||
|
|||
def __init__( | |||
self, | |||
*, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keyword only argument change is not handled in all the example files and documents.
minio/helpers.py
Outdated
self._map[bucket_name] = region | ||
|
||
def remove(self, bucket_name: str): | ||
"""Set region for the bucket.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo, it should be remove region for the bucket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tmp_file_path: Optional[str] = None, | ||
progress: Optional[ProgressType] = None, | ||
region: Optional[str] = None, | ||
extra_headers: Optional[HTTPHeaderDict] = None, | ||
extra_query_params: Optional[HTTPQueryDict] = None, | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are not taken care in the examples provided in this file as well as all examples and docs.
version_id=version_id, | ||
extra_headers=request_headers, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the reason for not including region and extra headers even though the method accepts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fget_object()
saves get_object stream to a temporary file. The temporary file name is like "{passed_file_path}.{etag_of_the_object}.part.minio". To get the etag of the object, we use stat_object()
. For this case, there is no need to pass any extra headers/query_params to stat_object()
. Finally the temporary file is renamed to passed_file_path
.
4d50239
to
f473f2f
Compare
Now all APIs accepts region, extra_headers and extra_query_params additional arguments for more control. Signed-off-by: Bala.FA <bala@minio.io>
f473f2f
to
f018d84
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to update API.md and README.md for:
- Minio() → keyword-only arguments
- metadata → user_metadata
region = self._get_region(bucket_name) | ||
region = self._get_region( | ||
bucket_name=bucket_name, | ||
region=region, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing: extra_headers and extra_query_params
"my-bucket", "my-object", "my-filename", | ||
bucket_name="my-bucket", | ||
object_name="my-object", | ||
file_path="my-filename", | ||
metadata={"My-Project": "one"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metadata={"My-Project": "one"}, | |
user_metadata={"My-Project": "one"}, |
Uh oh!
There was an error while loading. Please reload this page.