|
52 | 52 | CleanupStats, |
53 | 53 | Compaction, |
54 | 54 | CompactionMetrics, |
| 55 | + DatasetBasePath, |
55 | 56 | LanceSchema, |
56 | 57 | ScanStatistics, |
57 | 58 | _Dataset, |
@@ -4897,6 +4898,8 @@ def write_dataset( |
4897 | 4898 | auto_cleanup_options: Optional[AutoCleanupConfig] = None, |
4898 | 4899 | commit_message: Optional[str] = None, |
4899 | 4900 | transaction_properties: Optional[Dict[str, str]] = None, |
| 4901 | + initial_bases: Optional[List[DatasetBasePath]] = None, |
| 4902 | + target_bases: Optional[List[str]] = None, |
4900 | 4903 | ) -> LanceDataset: |
4901 | 4904 | """Write a given data_obj to the given uri |
4902 | 4905 |
|
@@ -4975,6 +4978,19 @@ def write_dataset( |
4975 | 4978 | and can be retrieved using read_transaction(). |
4976 | 4979 | If both `commit_message` and `properties` are provided, `commit_message` will |
4977 | 4980 | override any "lance.commit.message" key in `properties`. |
| 4981 | + initial_bases: list of DatasetBasePath, optional |
| 4982 | + New base paths to register in the manifest. Only used in **CREATE mode**. |
| 4983 | + Cannot be specified in APPEND or OVERWRITE modes. |
| 4984 | + target_bases: list of str, optional |
| 4985 | + References to base paths where data should be written. Can be |
| 4986 | + specified in all modes. |
| 4987 | +
|
| 4988 | + Each string is resolved by trying to match: |
| 4989 | + 1. Base name (e.g., "primary", "archive") from registered bases |
| 4990 | + 2. Base path URI (e.g., "s3://bucket1/data") |
| 4991 | +
|
| 4992 | + **CREATE mode**: References must match bases in `initial_bases` |
| 4993 | + **APPEND/OVERWRITE modes**: References must match bases in the existing manifest |
4978 | 4994 | """ |
4979 | 4995 | if use_legacy_format is not None: |
4980 | 4996 | warnings.warn( |
@@ -5016,6 +5032,8 @@ def write_dataset( |
5016 | 5032 | "enable_stable_row_ids": enable_stable_row_ids, |
5017 | 5033 | "auto_cleanup_options": auto_cleanup_options, |
5018 | 5034 | "transaction_properties": merged_properties, |
| 5035 | + "initial_bases": initial_bases, |
| 5036 | + "target_bases": target_bases, |
5019 | 5037 | } |
5020 | 5038 |
|
5021 | 5039 | if commit_lock: |
|
0 commit comments