Skip to content

Commit 233e23c

Browse files
authored
Merge branch 'main' into release-3.0.0
2 parents 563083c + fe955b7 commit 233e23c

40 files changed

+126
-148
lines changed

.github/workflows/cfn-nag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
}
6363
EOT
6464
python -m pip install --upgrade pip
65-
python -m pip install poetry==1.1.15 # 1.2.0 breaking resolution of packages
65+
python -m pip install poetry==1.2.2
6666
poetry config virtualenvs.create false --local
6767
poetry install -vvv
6868
- name: CDK Synth

.github/workflows/minimal-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install Requirements
3333
run: |
3434
python -m pip install --upgrade pip
35-
python -m pip install poetry==1.1.15
35+
python -m pip install poetry==1.2.2
3636
poetry config virtualenvs.create false --local
3737
poetry install --extras "sqlserver" -vvv
3838
- name: Test Metadata

.github/workflows/static-checking.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install Requirements
3232
run: |
3333
python -m pip install --upgrade pip
34-
python -m pip install poetry==1.1.15 # 1.2.0 breaking resolution of packages
34+
python -m pip install poetry==1.2.2
3535
poetry config virtualenvs.create false --local
3636
poetry install --extras "sqlserver sparql modin ray" -vvv
3737
- name: mypy check

awswrangler/s3/_write_dataset.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@
1616

1717

1818
def _get_bucketing_series(df: pd.DataFrame, bucketing_info: Tuple[List[str], int]) -> pd.Series:
19-
bucket_number_series = df.astype("O").apply(
20-
lambda row: _get_bucket_number(bucketing_info[1], [row[col_name] for col_name in bucketing_info[0]]),
21-
axis="columns",
19+
bucket_number_series = (
20+
df[bucketing_info[0]]
21+
# Prevent "upcasting" mixed types by casting to object
22+
.astype("O").apply(
23+
lambda row: _get_bucket_number(bucketing_info[1], [row[col_name] for col_name in bucketing_info[0]]),
24+
axis="columns",
25+
)
2226
)
2327
return bucket_number_series.astype(pd.CategoricalDtype(range(bucketing_info[1])))
2428

@@ -200,8 +204,7 @@ def _to_buckets(
200204
**func_kwargs: Any,
201205
) -> List[str]:
202206
_proxy: _WriteProxy = proxy if proxy else _WriteProxy(use_threads=False)
203-
df_groups = df.groupby(by=_get_bucketing_series(df=df, bucketing_info=bucketing_info))
204-
for bucket_number, subgroup in df_groups:
207+
for bucket_number, subgroup in df.groupby(by=_get_bucketing_series(df=df, bucketing_info=bucketing_info)):
205208
_proxy.write(
206209
func,
207210
boto3_session,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pydocstyle = "^6.1.1"
6767
doc8 = "^0.11.1"
6868
tox = "^3.25.1"
6969
pytest = "^7.1.2"
70-
pytest-cov = "^3.0.0"
70+
pytest-cov = "^4.0.0"
7171
pytest-rerunfailures = "^10.2"
7272
pytest-xdist = "^2.5.0"
7373
pytest-timeout = "^2.1.0"

test_infra/stacks/databases_stack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ def _setup_redshift(self) -> None:
232232
redshift_cluster = redshift.Cluster(
233233
self,
234234
"aws-sdk-pandas-redshift-cluster",
235+
removal_policy=RemovalPolicy.DESTROY,
235236
default_database_name=database,
236237
master_user=redshift.Login(
237238
master_username=self.db_username,
@@ -676,6 +677,7 @@ def _setup_neptune(self, iam_enabled: bool = False, port: int = 8182) -> None:
676677
cluster = neptune.DatabaseCluster(
677678
self,
678679
"aws-sdk-pandas-neptune-cluster",
680+
removal_policy=RemovalPolicy.DESTROY,
679681
vpc=self.vpc,
680682
instance_type=neptune.InstanceType.R5_LARGE,
681683
iam_authentication=iam_enabled,

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ commands =
3131
passenv = AWS_PROFILE AWS_DEFAULT_REGION AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN
3232
deps =
3333
{[testenv]deps}
34-
pytest-cov==3.0.0
34+
pytest-cov==4.0.0
3535
commands =
3636
pytest -n {posargs} -s -v --timeout=300 --reruns=2 --reruns-delay=60 --cov=awswrangler \
3737
--junitxml=test-reports/junit.xml --log-file=test-reports/logs.txt tests/unit

tutorials/001 - Introduction.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@
108108
],
109109
"metadata": {
110110
"kernelspec": {
111-
"display_name": "conda_python3",
111+
"display_name": "Python 3.9.14",
112112
"language": "python",
113-
"name": "conda_python3"
113+
"name": "python3"
114114
},
115115
"language_info": {
116116
"codemirror_mode": {
@@ -122,9 +122,9 @@
122122
"name": "python",
123123
"nbconvert_exporter": "python",
124124
"pygments_lexer": "ipython3",
125-
"version": "3.6.10"
125+
"version": "3.9.14"
126126
}
127127
},
128128
"nbformat": 4,
129129
"nbformat_minor": 4
130-
}
130+
}

tutorials/002 - Sessions.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
],
129129
"metadata": {
130130
"kernelspec": {
131-
"display_name": "Python 3.9.13 ('awswrangler-mo8sEp3D-py3.9')",
131+
"display_name": "Python 3.9.14",
132132
"language": "python",
133133
"name": "python3"
134134
},
@@ -142,7 +142,7 @@
142142
"name": "python",
143143
"nbconvert_exporter": "python",
144144
"pygments_lexer": "ipython3",
145-
"version": "3.9.13"
145+
"version": "3.9.14"
146146
},
147147
"vscode": {
148148
"interpreter": {

tutorials/003 - Amazon S3.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"path2 = f\"s3://{bucket}/csv/file2.csv\"\n",
123123
"\n",
124124
"wr.s3.to_csv(df1, path1, index=False)\n",
125-
"wr.s3.to_csv(df2, path2, index=False);"
125+
"wr.s3.to_csv(df2, path2, index=False)"
126126
]
127127
},
128128
{
@@ -362,7 +362,7 @@
362362
"path2 = f\"s3://{bucket}/parquet/file2.parquet\"\n",
363363
"\n",
364364
"wr.s3.to_parquet(df1, path1)\n",
365-
"wr.s3.to_parquet(df2, path2);"
365+
"wr.s3.to_parquet(df2, path2)"
366366
]
367367
},
368368
{
@@ -708,7 +708,7 @@
708708
"wr.s3.read_fwf(f\"s3://{bucket}/fwf/\", names=[\"id\", \"name\", \"date\"], last_modified_begin=begin_utc, last_modified_end=end_utc)\n",
709709
"wr.s3.read_json(f\"s3://{bucket}/json/\", last_modified_begin=begin_utc, last_modified_end=end_utc)\n",
710710
"wr.s3.read_csv(f\"s3://{bucket}/csv/\", last_modified_begin=begin_utc, last_modified_end=end_utc)\n",
711-
"wr.s3.read_parquet(f\"s3://{bucket}/parquet/\", last_modified_begin=begin_utc, last_modified_end=end_utc);"
711+
"wr.s3.read_parquet(f\"s3://{bucket}/parquet/\", last_modified_begin=begin_utc, last_modified_end=end_utc)"
712712
]
713713
},
714714
{
@@ -965,7 +965,7 @@
965965
],
966966
"metadata": {
967967
"kernelspec": {
968-
"display_name": "Python 3",
968+
"display_name": "Python 3.9.14",
969969
"language": "python",
970970
"name": "python3"
971971
},
@@ -979,9 +979,9 @@
979979
"name": "python",
980980
"nbconvert_exporter": "python",
981981
"pygments_lexer": "ipython3",
982-
"version": "3.8.5"
982+
"version": "3.9.14"
983983
}
984984
},
985985
"nbformat": 4,
986986
"nbformat_minor": 4
987-
}
987+
}

0 commit comments

Comments
 (0)