-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
✨ Source S3: v4 rollout/feature parity #29753
Merged
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a887fae
Support endpoint and config at the same time
maxi297 e4978f0
File-based CSV: do not add fields if they are not part of the schema
maxi297 5a75d13
File-based CSV: null_values, true_values and false_values default to …
maxi297 5af9d13
Fix pagination on S3 V4
maxi297 5e2cf24
Update configured catalogs to align with the platform as it provides …
maxi297 4f2471e
source-s3 release documentation/version bump
maxi297 3f275d5
formatting
maxi297 46c845f
formatting
maxi297 37a7411
Fix CDK tests
maxi297 5208113
Formatting
maxi297 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,14 +46,8 @@ def documentation_url(cls) -> AnyUrl: | |
def validate_optional_args(cls, values): | ||
aws_access_key_id = values.get("aws_access_key_id") | ||
aws_secret_access_key = values.get("aws_secret_access_key") | ||
endpoint = values.get("endpoint") | ||
if aws_access_key_id or aws_secret_access_key: | ||
if not (aws_access_key_id and aws_secret_access_key): | ||
raise ValidationError( | ||
"`aws_access_key_id` and `aws_secret_access_key` are both required to authenticate with AWS.", model=Config | ||
) | ||
if endpoint: | ||
raise ValidationError( | ||
"Either `aws_access_key_id` and `aws_secret_access_key` or `endpoint` must be set, but not both.", model=Config | ||
) | ||
if (aws_access_key_id or aws_secret_access_key) and not (aws_access_key_id and aws_secret_access_key): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
raise ValidationError( | ||
"`aws_access_key_id` and `aws_secret_access_key` are both required to authenticate with AWS.", model=Config | ||
) | ||
return values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,9 +80,28 @@ def _transform_file_format(cls, format_options: Union[CsvFormat, ParquetFormat, | |
"delimiter": format_options.delimiter, | ||
"quote_char": format_options.quote_char, | ||
"double_quote": format_options.double_quote, | ||
"null_values": ["", "null", "NULL", "N/A", "NA", "NaN", "None"], | ||
"true_values": ["y", "yes", "t", "true", "on", "1"], | ||
"false_values": ["n", "no", "f", "false", "off", "0"], | ||
# values taken from https://github.com/apache/arrow/blob/43c05c56b37daa93e76b94bc3e6952d56d1ea3f2/cpp/src/arrow/csv/options.cc#L41-L45 | ||
"null_values": additional_reader_options.pop("null_values", [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
"", | ||
"#N/A", | ||
"#N/A N/A", | ||
"#NA", | ||
"-1.#IND", | ||
"-1.#QNAN", | ||
"-NaN", | ||
"-nan", | ||
"1.#IND", | ||
"1.#QNAN", | ||
"N/A", | ||
"NA", | ||
"NULL", | ||
"NaN", | ||
"n/a", | ||
"nan", | ||
"null", | ||
]), | ||
"true_values": additional_reader_options.pop("true_values", ["1", "True", "TRUE", "true"]), | ||
"false_values": additional_reader_options.pop("false_values", ["0", "False", "FALSE", "false"]), | ||
"inference_type": "Primitive Types Only" if format_options.infer_datatypes else "None", | ||
"strings_can_be_null": additional_reader_options.pop("strings_can_be_null", False), | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,7 +123,7 @@ def _page( | |
total_n_keys_for_prefix = 0 | ||
kwargs = {"Bucket": bucket} | ||
while True: | ||
response = s3.list_objects_v2(Bucket=bucket, Prefix=prefix) if prefix else s3.list_objects_v2(Bucket=bucket) | ||
response = s3.list_objects_v2(Prefix=prefix, **kwargs) if prefix else s3.list_objects_v2(**kwargs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
key_count = response.get("KeyCount") | ||
total_n_keys_for_prefix += key_count | ||
logger.info(f"Received {key_count} objects from S3 for prefix '{prefix}'.") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👍