|
9 | 9 | from kbcstorage.base import Endpoint |
10 | 10 | from kbcstorage.files import Files |
11 | 11 | from kbcstorage.jobs import Jobs |
12 | | - |
| 12 | +from typing import List # the legacy Workspaces class below unfortunately defines its own method called list |
13 | 13 |
|
14 | 14 | def _make_body(mapping, source_key='source'): |
15 | 15 | """ |
@@ -135,17 +135,18 @@ def set_public_key(self, workspace_id, public_key): |
135 | 135 | url = '{}/{}/public-key'.format(self.base_url, workspace_id) |
136 | 136 | return self._post(url, json=data) |
137 | 137 |
|
138 | | - def load_tables(self, workspace_id: int | str, table_mapping: dict | list[dict], preserve=True, load_type='load'): |
| 138 | + def load_tables(self, workspace_id: int | str, table_mapping: dict | List[dict], preserve=True, load_type='load'): |
139 | 139 | """ |
140 | 140 | Load tabes from storage into a workspace. |
141 | 141 |
|
142 | 142 | Args: |
143 | 143 | workspace_id (int or str): The id of the workspace to which to load |
144 | 144 | the tables. |
145 | | - table_mapping (:obj:`dict`): Source table names mapped to |
146 | | - destination table names. |
| 145 | + table_mapping (:obj:`dict` or :obj:`list`): Source table names mapped to |
| 146 | + destination table names. or a list of dicts with detailed tables specification. |
147 | 147 | preserve (bool): If False, drop tables, else keep tables in |
148 | 148 | workspace. |
| 149 | + load_type (str): Type of load, either 'load' or 'load-clone'. Defaults to 'load'. |
149 | 150 |
|
150 | 151 | Raises: |
151 | 152 | requests.HTTPError: If the API request fails. |
|
0 commit comments