-
Notifications
You must be signed in to change notification settings - Fork 22
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
add endpoint url parameter #34
Conversation
Thank you for your PR. Its' great. I tried to use your code, but it didn't work for wildcard path on s3 like Probably you have to modify util.py like def resolve_wildcard(self) -> List[ParquetFile]:
list_res = self.aws_session.client('s3', endpoint_url=self.endpoint_url)\
.list_objects_v2(
Bucket=self.bucket,
Prefix=self.key[:-1] # remove *
)
if list_res['IsTruncated']:
raise Exception(f'Too much file match s3://{self.bucket}/{self.key}')
if list_res['KeyCount'] == 0:
return []
keys = [e['Key'] for e in list_res['Contents']]
return sorted(
[S3ParquetFile(aws_session=self.aws_session, bucket=self.bucket, key=key, endpoint_url=self.endpoint_url) for key in keys], // you have to add endpoint_url argment
key=lambda x: x.key
) Could you confirm this? |
S3ParquetFile is also used in https://github.com/ktrueda/parquet-tools/blob/master/tests/test_util.py . |
thank you for point this out. I will make the according changes! |
I added a simple default value for the endpoint_url. |
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.
Thank you.
I added a parameter to support custom endpoints.
The changes are minimal invasive and should not change any existing behavior or break backwards compatibility.
I tested these changes with a local minio deployment.