Skip to content

Commit 625d6fe

Browse files
Use underscores for semantic versions in table names (#1093)
* Use underscores for semantic versions in table names * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixup! [pre-commit.ci] auto fixes from pre-commit.com hooks * fixup! [pre-commit.ci] auto fixes from pre-commit.com hooks * fixup! [pre-commit.ci] auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c047f20 commit 625d6fe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/datachain/data_storage/warehouse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def dataset_table_name(self, dataset_name: str, version: str) -> str:
258258
if Client.is_data_source_uri(dataset_name):
259259
# for datasets that are created for bucket listing we use different prefix
260260
prefix = self.DATASET_SOURCE_TABLE_PREFIX
261-
return f"{prefix}{dataset_name}_{version}"
261+
return f"{prefix}{dataset_name}_{version.replace('.', '_')}"
262262

263263
def temp_table_name(self) -> str:
264264
return self.TMP_TABLE_NAME_PREFIX + _random_string(6)

tests/func/test_warehouse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def test_dataset_stats_no_table(cloud_test_catalog, dogs_dataset):
22
catalog = cloud_test_catalog.catalog
3-
catalog.warehouse.drop_dataset_rows_table(dogs_dataset, 1)
4-
num_objects, size = catalog.warehouse.dataset_stats(dogs_dataset, 1)
3+
catalog.warehouse.drop_dataset_rows_table(dogs_dataset, version="1.0.0")
4+
num_objects, size = catalog.warehouse.dataset_stats(dogs_dataset, version="1.0.0")
55
assert num_objects is None
66
assert size is None

0 commit comments

Comments
 (0)