Skip to content

Commit 408cbf4

Browse files
zxqfd555Manul from Pathway
authored andcommitted
remove deprecated pw.io.s3_csv.read (#8976)
GitOrigin-RevId: 9c8dea7fcc8a025497968a38e1e55538624e9f61
1 parent bc50b3a commit 408cbf4

File tree

6 files changed

+28
-159
lines changed

6 files changed

+28
-159
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1212
### Changed
1313
- **BREAKING** The Elasticsearch and BigQuery connectors have been moved to the Scale license tier. You can obtain the Scale tier license for free at https://pathway.com/get-license.
1414
- **BREAKING** `pw.io.fs.read` no longer accepts `format="raw"`. Use `format="binary"` to read binary objects, `format="plaintext_by_file"` to read plaintext objects per file, or `format="plaintext"` to read plaintext objects split into lines.
15+
- **BREAKING** The `pw.io.s3_csv.read` connector has been removed. Please use `pw.io.s3.read` with `format="csv"` instead.
16+
17+
### Fixed
18+
- `pw.io.s3.read` and `pw.io.s3.write` now also check the `AWS_PROFILE` environment variable for AWS credentials if none are explicitly provided.
1519

1620
## [0.24.1] - 2025-07-03
1721

integration_tests/s3/test_s3_generic.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ def test_s3_backfilling(snapshot_access, tmp_path: pathlib.Path, s3_path: str):
2424

2525
input_contents = "key,value\n1,Hello\n2,World"
2626
put_aws_object(s3_input_path, input_contents)
27-
table = pw.io.s3_csv.read(
27+
table = pw.io.s3.read(
2828
s3_path,
2929
aws_s3_settings=get_aws_s3_settings(),
3030
schema=pw.schema_from_types(key=int, value=str),
31+
format="csv",
3132
mode="static",
3233
autocommit_duration_ms=1000,
3334
name="1",
@@ -44,11 +45,12 @@ def test_s3_backfilling(snapshot_access, tmp_path: pathlib.Path, s3_path: str):
4445

4546
input_contents = "key,value\n1,Hello\n2,World\n3,Bonjour\n4,Monde\n"
4647
put_aws_object(s3_input_path, input_contents)
47-
table = pw.io.s3_csv.read(
48+
table = pw.io.s3.read(
4849
s3_path,
4950
aws_s3_settings=get_aws_s3_settings(),
5051
schema=pw.schema_from_types(key=int, value=str),
5152
mode="static",
53+
format="csv",
5254
autocommit_duration_ms=1000,
5355
name="1",
5456
)
@@ -68,11 +70,12 @@ def test_s3_backfilling(snapshot_access, tmp_path: pathlib.Path, s3_path: str):
6870
output_path = tmp_path / "output_final.csv"
6971
put_aws_object(s3_input_path, input_contents)
7072
put_aws_object(s3_input_path_2, input_contents_2)
71-
table = pw.io.s3_csv.read(
73+
table = pw.io.s3.read(
7274
s3_path,
7375
aws_s3_settings=get_aws_s3_settings(),
7476
schema=pw.schema_from_types(key=int, value=str),
7577
mode="static",
78+
format="csv",
7679
autocommit_duration_ms=1000,
7780
name="1",
7881
)
@@ -189,15 +192,16 @@ def test_s3_alternative_path(tmp_path: pathlib.Path, s3_path: str):
189192
put_aws_object(input_s3_path, input_contents)
190193
write_lines(model_output_path, input_contents)
191194

192-
table = pw.io.s3_csv.read(
195+
table = pw.io.s3.read(
193196
f"s3://aws-integrationtest/{input_s3_path}",
194-
aws_s3_settings=pw.io.s3_csv.AwsS3Settings(
197+
aws_s3_settings=pw.io.s3.AwsS3Settings(
195198
access_key=os.environ["AWS_S3_ACCESS_KEY"],
196199
secret_access_key=os.environ["AWS_S3_SECRET_ACCESS_KEY"],
197200
region="eu-central-1",
198201
),
199202
schema=pw.schema_from_types(key=int, value=str),
200203
mode="static",
204+
format="csv",
201205
autocommit_duration_ms=1000,
202206
)
203207

@@ -217,13 +221,14 @@ def test_s3_wrong_path(tmp_path: pathlib.Path, s3_path: str):
217221
input_s3_path = f"{s3_path}/input.csv"
218222
output_path = tmp_path / "output.csv"
219223

220-
table = pw.io.s3_csv.read(
224+
table = pw.io.s3.read(
221225
f"s3://aws-integrationtest/{input_s3_path}",
222-
aws_s3_settings=pw.io.s3_csv.AwsS3Settings(
226+
aws_s3_settings=pw.io.s3.AwsS3Settings(
223227
access_key=os.environ["AWS_S3_ACCESS_KEY"],
224228
secret_access_key=os.environ["AWS_S3_SECRET_ACCESS_KEY"],
225229
region="eu-central-1",
226230
),
231+
format="csv",
227232
schema=pw.schema_from_types(key=int, value=str),
228233
mode="static",
229234
autocommit_duration_ms=1000,
@@ -248,10 +253,11 @@ def test_s3_creds_from_profiles(tmp_path: pathlib.Path, s3_path: str, monkeypatc
248253
put_aws_object(input_s3_path, input_contents)
249254
write_lines(model_output_path, input_contents)
250255

251-
table = pw.io.s3_csv.read(
256+
table = pw.io.s3.read(
252257
f"s3://aws-integrationtest/{input_s3_path}",
253-
aws_s3_settings=pw.io.s3_csv.AwsS3Settings(region="eu-central-1"),
258+
aws_s3_settings=pw.io.s3.AwsS3Settings(region="eu-central-1"),
254259
schema=pw.schema_from_types(key=int, value=str),
260+
format="csv",
255261
mode="static",
256262
autocommit_duration_ms=1000,
257263
)

python/pathway/io/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
questdb,
2828
redpanda,
2929
s3,
30-
s3_csv,
3130
slack,
3231
sqlite,
3332
)
@@ -59,7 +58,6 @@
5958
"slack",
6059
"subscribe",
6160
"s3",
62-
"s3_csv",
6361
"gdrive",
6462
"sqlite",
6563
"pubsub",

python/pathway/io/s3_csv/__init__.py

Lines changed: 0 additions & 146 deletions
This file was deleted.

python/pathway/tests/test_error_messages.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ def test_traceback_static():
437437
pw.io.plaintext.read,
438438
pw.io.python.read,
439439
pw.io.redpanda.read,
440-
pw.io.s3_csv.read,
441440
pw.io.csv.write,
442441
pw.io.fs.write,
443442
pw.io.http.write,

src/python_api.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3992,7 +3992,15 @@ impl AwsS3Settings {
39923992
} else {
39933993
let aws_credentials = AwsCredentials::from_sts_env("aws-creds")
39943994
.or_else(|_| AwsCredentials::from_env())
3995-
.or_else(|_| AwsCredentials::from_profile(self.profile.as_deref()))
3995+
// The rust-s3 crate doesn't check the AWS_PROFILE env var, so we do it by ourselves
3996+
.or_else(|_| {
3997+
AwsCredentials::from_profile(
3998+
self.profile
3999+
.clone()
4000+
.or_else(|| std::env::var("AWS_PROFILE").ok())
4001+
.as_deref(),
4002+
)
4003+
})
39964004
.or_else(|_| AwsCredentials::from_instance_metadata());
39974005

39984006
// first, try to deduce credentials from various sources

0 commit comments

Comments
 (0)