Skip to content

Commit 41b20b3

Browse files
refactor(dataset): dataset add/import refactoring (#3001)
1 parent 3905d78 commit 41b20b3

34 files changed

+1886
-1624
lines changed

docs/cheatsheet/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
napoleon_numpy_docstring = False
170170

171171
# sphinx type references only work for types that documentation is generated for
172-
# Suppress warnungs for these types that are referenced but not documented themselves.
172+
# Suppress warnings for these types that are referenced but not documented themselves.
173173
nitpick_ignore = [
174174
("py:class", "Path"),
175175
("py:class", "OID_TYPE"),

docs/reference/core.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ Providers for dataset import and export
135135
:members:
136136
:show-inheritance:
137137

138+
.. automodule:: renku.core.dataset.providers.git
139+
:members:
140+
:show-inheritance:
141+
142+
.. automodule:: renku.core.dataset.providers.local
143+
:members:
144+
:show-inheritance:
145+
138146
.. automodule:: renku.core.dataset.providers.models
139147
:members:
140148
:show-inheritance:
@@ -147,6 +155,14 @@ Providers for dataset import and export
147155
:members:
148156
:show-inheritance:
149157

158+
.. automodule:: renku.core.dataset.providers.repository
159+
:members:
160+
:show-inheritance:
161+
162+
.. automodule:: renku.core.dataset.providers.web
163+
:members:
164+
:show-inheritance:
165+
150166
.. automodule:: renku.core.dataset.providers.zenodo
151167
:members:
152168
:show-inheritance:

docs/spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ deployer
5555
deserialization
5656
deserialize
5757
Deserialize
58+
deserialized
5859
Deserialized
5960
deserializing
6061
discoverable

renku/command/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
show_dataset,
3333
update_datasets,
3434
)
35-
from renku.core.dataset.dataset_add import add_data_to_dataset
35+
from renku.core.dataset.dataset_add import add_to_dataset
3636
from renku.core.dataset.tag import add_dataset_tag, list_dataset_tags, remove_dataset_tags
3737

3838

@@ -65,7 +65,7 @@ def show_dataset_command():
6565

6666
def add_to_dataset_command():
6767
"""Create a command for adding data to datasets."""
68-
command = Command().command(add_data_to_dataset).lock_dataset().with_database(write=True)
68+
command = Command().command(add_to_dataset).lock_dataset().with_database(write=True)
6969
return command.require_migration().with_commit(raise_if_empty=True, commit_only=DATASET_METADATA_PATHS)
7070

7171

renku/core/dataset/context.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818
"""Dataset context managers."""
19+
20+
import contextlib
21+
import time
1922
from typing import Optional
2023

2124
from renku.command.command_builder.command import inject
@@ -71,3 +74,15 @@ def __exit__(self, exc_type, exc_value, traceback):
7174
self.datasets_provenance = DatasetsProvenance()
7275
self.datasets_provenance.add_or_update(self.dataset, creator=self.creator)
7376
self.database_dispatcher.current_database.commit()
77+
78+
79+
@contextlib.contextmanager
80+
def wait_for(delay: float):
81+
"""Make sure that at least ``delay`` seconds are passed during the execution of the wrapped code block."""
82+
start = time.time()
83+
84+
yield
85+
86+
exec_time = time.time() - start
87+
if exec_time < delay:
88+
time.sleep(delay - exec_time)

0 commit comments

Comments
 (0)