Skip to content
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

fix nested directory object display #3415

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

prakashsvmx
Copy link
Member

@prakashsvmx prakashsvmx commented Aug 1, 2024

fix nested directory object display

➜ mc ls local22/demo -r                                              
[2024-08-01 10:07:41 IST]     2B STANDARD 2
[2024-08-01 10:40:01 IST]     2B STANDARD gopitestfolder/3.txt
[2024-08-01 10:26:13 IST]     2B STANDARD gopitestfolder/ingest-2/1.txt
[2024-08-01 08:41:58 IST]     0B STANDARD gopitestfolder/ingest/             # This must be skipped. 
[2024-08-01 10:23:45 IST]     2B STANDARD gopitestfolder/ingest/1.txt
[2024-08-01 10:08:40 IST]     2B STANDARD gopitestfolder/ingest/2
[2024-08-01 11:05:08 IST]     2B STANDARD gopitestfolder/ingest/ingest/ingest/9.txt
[2024-08-01 08:41:58 IST] 7.4MiB STANDARD gopitestfolder/ingest/minio_test_file-2024-08-01 08:41:58.166090.parquet

Repro code
import pyarrow as pa
from pyarrow import fs
import pyarrow.parquet as pq
from datetime import datetime

minio_url = "http://localhost:22000"
minio_access_key = "minio"
minio_secret_key = "minio123"
bucket = "demo"

test_data = []

for i in range(1000000):
    test_data.append(
        {
            "id": i,
            "strfield": "foo",
            "dtimefield": datetime.now(),
            "int": 4,
            "bigint": 1e20,
            "float": 4.4,
        }
    )


table = pa.Table.from_pylist(test_data)

filesystem = fs.S3FileSystem(
    endpoint_override=minio_url,
    access_key=minio_access_key,
    secret_key=minio_secret_key,

)
fname = f"gopitestfolder/ingest/minio_test_file-{datetime.now()}.parquet"
fh = filesystem.open_output_stream(f"{bucket}/{fname}")
writer = pq.ParquetWriter(fh, schema=table.schema)
writer.write_table(table)
writer.close()
fh.close()

fname2 = f"gopitestfolder/ingest/minio_test_file-{datetime.now()}.parquet"
fh = filesystem.open_output_stream(f"{bucket}/{fname2}")
writer = pq.ParquetWriter(fh, schema=table.schema)
writer.write_table(table)
writer.close()
fh.close()
filesystem.delete_file(f"{bucket}/{fname2}")

How does it look

Current issue vs Fixed.

issue_vs_fixed

Copy link
Collaborator

@cesnietor cesnietor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Copy link
Collaborator

@bexsoft bexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bexsoft bexsoft merged commit b274add into minio:master Aug 2, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants