Skip to content

Commit 9ee29b3

Browse files
Fix cap redis version (#519)
- cap redis client version to avoid breaking uploader plugin - fixed azure and s3 e2e test script so that they no longer report error
1 parent 3988cfb commit 9ee29b3

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.31
2+
3+
* **Cap redis client version to 5.3.0**
4+
15
## 1.0.30
26

37
* **Fixed issue in the blob storage destination connector where files with the same name were overwriting each other**

requirements/connectors/redis.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
redis
1+
redis<=5.3.0

test_e2e/dest/s3.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ PYTHONPATH=${PYTHONPATH:-.} "$RUN_SCRIPT" \
4949

5050
# Simply check the number of files uploaded
5151
expected_num_files=1
52-
num_files_in_s3=$(AWS_ACCESS_KEY_ID="$S3_INGEST_TEST_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_INGEST_TEST_SECRET_KEY" aws s3 ls "${DESTINATION_S3}" --region us-east-2 | grep -c "\.json$")
52+
num_files_in_s3=$(AWS_ACCESS_KEY_ID="$S3_INGEST_TEST_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_INGEST_TEST_SECRET_KEY" aws s3 ls "${DESTINATION_S3}" --region us-east-2 --recursive | grep -c "\.json$")
53+
5354
if [ "$num_files_in_s3" -ne "$expected_num_files" ]; then
5455
echo "Expected $expected_num_files files to be uploaded to s3, but found $num_files_in_s3 files."
5556
exit 1

test_e2e/python/test-azure-output.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
2-
import azure.core.exceptions
32
import click
43
from azure.storage.blob import ContainerClient
54

@@ -19,14 +18,20 @@ def down(connection_string: str, container: str, blob_path: str):
1918
)
2019
blob_list = [b.name for b in list(container_client.list_blobs(name_starts_with=blob_path))]
2120
print(f"deleting all content from {container}/{blob_path}")
22-
# Delete all content in folder first
23-
container_client.delete_blobs(*[b for b in blob_list if b != blob_path])
24-
25-
# Delete folder itself
26-
try:
27-
container_client.delete_blob(blob_path)
28-
except azure.core.exceptions.ResourceNotFoundError:
29-
print(f"folder {blob_path} not found")
21+
22+
files = []
23+
folders = []
24+
for blob in blob_list:
25+
blob_props = container_client.get_blob_client(blob).get_blob_properties()
26+
if blob_props.size == 0 and not blob.endswith("/_empty"):
27+
folders.append(blob)
28+
else:
29+
files.append(blob)
30+
31+
# Delete all content in folders first, then delete the folders
32+
container_client.delete_blobs(*files)
33+
for folder in folders[::-1]:
34+
container_client.delete_blob(folder)
3035

3136

3237
@cli.command()

unstructured_ingest/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.30" # pragma: no cover
1+
__version__ = "1.0.31" # pragma: no cover

unstructured_ingest/processes/connectors/fsspec/fsspec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ def precheck(self) -> None:
343343
raise self.wrap_error(e=e)
344344

345345
def get_upload_path(self, file_data: FileData) -> Path:
346-
upload_path = (
347-
Path(self.upload_config.path_without_protocol) / file_data.source_identifiers.fullpath
348-
)
346+
upload_path = Path(
347+
self.upload_config.path_without_protocol
348+
) / file_data.source_identifiers.fullpath.lstrip("/")
349349
updated_upload_path = upload_path.parent / f"{upload_path.name}.json"
350350
return updated_upload_path
351351

0 commit comments

Comments
 (0)