diff --git a/src/dandi_s3_log_parser/_dandiset_mapper.py b/src/dandi_s3_log_parser/_dandiset_mapper.py index bd0b0f4..d0bb296 100644 --- a/src/dandi_s3_log_parser/_dandiset_mapper.py +++ b/src/dandi_s3_log_parser/_dandiset_mapper.py @@ -74,7 +74,7 @@ def _map_reduced_logs_to_dandiset( all_reduced_logs = [] for asset in dandiset_version.get_assets(): - asset_id = asset.identifier + asset_id = asset.identifier.replace("-", "_") asset_suffixes = pathlib.Path(asset.path).suffixes blob_or_zarr = "blobs" if ".zarr" not in asset_suffixes else "zarr" @@ -91,7 +91,7 @@ def _map_reduced_logs_to_dandiset( for ip_address in reduced_log["ip_address"] ] - reordered_reduced_log = reduced_log.reindex(columns=("asset_id", "timestamp", "bytes_sent", "region")) + reordered_reduced_log = reduced_log.reindex(columns=("filename", "timestamp", "bytes_sent", "region")) all_reduced_logs.append(reordered_reduced_log) if len(all_reduced_logs) == 0: diff --git a/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/0.210812.1448.tsv b/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/0.210812.1448.tsv index c045fef..a973f99 100644 --- a/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/0.210812.1448.tsv +++ b/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/0.210812.1448.tsv @@ -1,3 +1,3 @@ - asset_id timestamp bytes_sent region + filename timestamp bytes_sent region 0 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-03-16 02:21:12 512 unknown 1 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-05-04 05:06:35 512 unknown diff --git a/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/0.230629.1955.tsv b/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/0.230629.1955.tsv index c045fef..a973f99 100644 --- a/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/0.230629.1955.tsv +++ b/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/0.230629.1955.tsv @@ -1,3 +1,3 @@ - asset_id timestamp bytes_sent region + filename timestamp bytes_sent region 0 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-03-16 02:21:12 512 unknown 1 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-05-04 05:06:35 512 unknown diff --git a/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/draft.tsv b/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/draft.tsv index c045fef..a973f99 100644 --- a/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/draft.tsv +++ b/tests/examples/mapped_to_dandiset_example_0/expected_output/000003/draft.tsv @@ -1,3 +1,3 @@ - asset_id timestamp bytes_sent region + filename timestamp bytes_sent region 0 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-03-16 02:21:12 512 unknown 1 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-05-04 05:06:35 512 unknown diff --git a/tests/examples/mapped_to_dandiset_example_0/expected_output/000013/0.220126.2143.tsv b/tests/examples/mapped_to_dandiset_example_0/expected_output/000013/0.220126.2143.tsv index 041db08..27aa95f 100644 --- a/tests/examples/mapped_to_dandiset_example_0/expected_output/000013/0.220126.2143.tsv +++ b/tests/examples/mapped_to_dandiset_example_0/expected_output/000013/0.220126.2143.tsv @@ -1,3 +1,3 @@ - asset_id timestamp bytes_sent region + filename timestamp bytes_sent region 0 cbcf1d6d-7f64-4d1f-8692-75e09e177ca6 2021-04-24 12:03:05 1443 unknown 1 cbcf1d6d-7f64-4d1f-8692-75e09e177ca6 2021-12-31 23:06:42 1443 unknown diff --git a/tests/examples/mapped_to_dandiset_example_0/expected_output/000013/draft.tsv b/tests/examples/mapped_to_dandiset_example_0/expected_output/000013/draft.tsv index 041db08..27aa95f 100644 --- a/tests/examples/mapped_to_dandiset_example_0/expected_output/000013/draft.tsv +++ b/tests/examples/mapped_to_dandiset_example_0/expected_output/000013/draft.tsv @@ -1,3 +1,3 @@ - asset_id timestamp bytes_sent region + filename timestamp bytes_sent region 0 cbcf1d6d-7f64-4d1f-8692-75e09e177ca6 2021-04-24 12:03:05 1443 unknown 1 cbcf1d6d-7f64-4d1f-8692-75e09e177ca6 2021-12-31 23:06:42 1443 unknown diff --git a/tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_5e9e92e1-f044-4aa0-ab47-1cfcb8899348.tsv b/tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_5e9e92e1_f044_4aa0_ab47_1cfcb8899348.tsv similarity index 100% rename from tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_5e9e92e1-f044-4aa0-ab47-1cfcb8899348.tsv rename to tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_5e9e92e1_f044_4aa0_ab47_1cfcb8899348.tsv diff --git a/tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_a7b032b8-1e31-429f-975f-52a28cec6629.tsv b/tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_a7b032b8_1e31-429f_975f_52a28cec6629.tsv similarity index 100% rename from tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_a7b032b8-1e31-429f-975f-52a28cec6629.tsv rename to tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_a7b032b8_1e31-429f_975f_52a28cec6629.tsv diff --git a/tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_cbcf1d6d-7f64-4d1f-8692-75e09e177ca6.tsv b/tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_cbcf1d6d_7f64_4d1f_8692_75e09e177ca6.tsv similarity index 100% rename from tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_cbcf1d6d-7f64-4d1f-8692-75e09e177ca6.tsv rename to tests/examples/mapped_to_dandiset_example_0/reduced_logs/blobs_cbcf1d6d_7f64_4d1f_8692_75e09e177ca6.tsv