lamindb_setup 1.1.0__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/.pre-commit-config.yaml +2 -2
  2. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/PKG-INFO +1 -1
  3. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/__init__.py +1 -1
  4. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_schema_metadata.py +13 -2
  5. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_aws_options.py +7 -1
  6. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_private_django_api.py +0 -5
  7. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/upath.py +6 -1
  8. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/noxfile.py +3 -3
  9. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/test_edge_request.py +1 -1
  10. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-local/test_update_schema_in_hub.py +17 -0
  11. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-prod/test_upath.py +9 -0
  12. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/.github/workflows/build.yml +0 -0
  13. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/.github/workflows/doc-changes.yml +0 -0
  14. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/.gitignore +0 -0
  15. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/LICENSE +0 -0
  16. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/README.md +0 -0
  17. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/changelog.md +0 -0
  18. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
  19. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
  20. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
  21. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
  22. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
  23. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
  24. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
  25. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-cloud/08-test-multi-session.ipynb +0 -0
  26. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-cloud/test_notebooks.py +0 -0
  27. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test-cache-management.ipynb +0 -0
  28. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
  29. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
  30. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test-empty-init.ipynb +0 -0
  31. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test-import-schema.ipynb +0 -0
  32. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test-init-load-local-anonymously.ipynb +0 -0
  33. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
  34. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
  35. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
  36. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/hub-prod/test_notebooks2.py +0 -0
  37. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/index.md +0 -0
  38. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/notebooks.md +0 -0
  39. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/docs/reference.md +0 -0
  40. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_cache.py +0 -0
  41. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_check.py +0 -0
  42. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_check_setup.py +0 -0
  43. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_close.py +0 -0
  44. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_connect_instance.py +0 -0
  45. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_delete.py +0 -0
  46. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_django.py +0 -0
  47. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_entry_points.py +0 -0
  48. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_exportdb.py +0 -0
  49. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_importdb.py +0 -0
  50. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_init_instance.py +0 -0
  51. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_migrate.py +0 -0
  52. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_register_instance.py +0 -0
  53. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_schema.py +0 -0
  54. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_set_managed_storage.py +0 -0
  55. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_setup_user.py +0 -0
  56. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/_silence_loggers.py +0 -0
  57. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/__init__.py +0 -0
  58. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_aws_storage.py +0 -0
  59. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_deprecated.py +0 -0
  60. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_docs.py +0 -0
  61. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_hub_client.py +0 -0
  62. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_hub_core.py +0 -0
  63. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_hub_crud.py +0 -0
  64. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_hub_utils.py +0 -0
  65. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_settings.py +0 -0
  66. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_settings_instance.py +0 -0
  67. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_settings_load.py +0 -0
  68. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_settings_save.py +0 -0
  69. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_settings_storage.py +0 -0
  70. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_settings_store.py +0 -0
  71. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_settings_user.py +0 -0
  72. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/_setup_bionty_sources.py +0 -0
  73. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
  74. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/django.py +0 -0
  75. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/exceptions.py +0 -0
  76. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/hashing.py +0 -0
  77. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/lamindb_setup/core/types.py +0 -0
  78. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/pyproject.toml +0 -0
  79. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/scripts/script-init-pass-user-no-writes.py +0 -0
  80. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/scripts/script-to-fail-managed-storage.py +0 -0
  81. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/test_connect_instance.py +0 -0
  82. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/test_delete_instance.py +0 -0
  83. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/test_fail_managed_storage.py +0 -0
  84. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/test_init_instance.py +0 -0
  85. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/test_init_pass_user_no_writes.py +0 -0
  86. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/test_login.py +0 -0
  87. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/test_migrate.py +0 -0
  88. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-cloud/test_set_storage.py +0 -0
  89. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-local/conftest.py +0 -0
  90. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-local/test_all.py +0 -0
  91. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-prod/conftest.py +0 -0
  92. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-prod/test_aws_options_manager.py +0 -0
  93. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-prod/test_django.py +0 -0
  94. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-prod/test_global_settings.py +0 -0
  95. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
  96. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/storage/test_entry_point.py +0 -0
  97. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/storage/test_hashing.py +0 -0
  98. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/storage/test_storage_access.py +0 -0
  99. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/storage/test_storage_basis.py +0 -0
  100. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/storage/test_storage_settings.py +0 -0
  101. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/storage/test_storage_stats.py +0 -0
  102. {lamindb_setup-1.1.0 → lamindb_setup-1.2.0}/tests/storage/test_to_url.py +0 -0
@@ -1,6 +1,6 @@
1
1
  repos:
2
- - repo: https://github.com/pre-commit/mirrors-prettier
3
- rev: v4.0.0-alpha.4
2
+ - repo: https://github.com/rbubley/mirrors-prettier
3
+ rev: v3.5.1
4
4
  hooks:
5
5
  - id: prettier
6
6
  exclude: |
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lamindb_setup
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Requires-Python: >=3.10
@@ -33,7 +33,7 @@ Modules & settings:
33
33
 
34
34
  """
35
35
 
36
- __version__ = "1.1.0" # denote a release candidate for 0.1.0 with 0.1rc1
36
+ __version__ = "1.2.0" # denote a release candidate for 0.1.0 with 0.1rc1
37
37
 
38
38
  import os
39
39
 
@@ -148,6 +148,8 @@ class FieldMetadata(BaseModel):
148
148
  model_name: str
149
149
  schema_name: str
150
150
  is_link_table: bool
151
+ is_primary_key: bool
152
+ is_editable: bool
151
153
  relation_type: RelationType | None = None
152
154
  related_field_name: str | None = None
153
155
  related_model_name: str | None = None
@@ -156,6 +158,8 @@ class FieldMetadata(BaseModel):
156
158
 
157
159
  class _ModelHandler:
158
160
  def __init__(self, model, module_name: str, included_modules: list[str]) -> None:
161
+ from lamindb.models import LinkORM
162
+
159
163
  self.model = model
160
164
  self.class_name = model.__name__
161
165
  self.module_name = module_name
@@ -163,12 +167,14 @@ class _ModelHandler:
163
167
  self.table_name = model._meta.db_table
164
168
  self.included_modules = included_modules
165
169
  self.fields = self._get_fields_metadata(self.model)
170
+ self.is_link_table = issubclass(model, LinkORM)
166
171
 
167
172
  def to_dict(self, include_django_objects: bool = True):
168
173
  _dict = {
169
174
  "fields": self.fields.copy(),
170
175
  "class_name": self.class_name,
171
176
  "table_name": self.table_name,
177
+ "is_link_table": self.is_link_table,
172
178
  }
173
179
 
174
180
  for field_name in self.fields.keys():
@@ -242,13 +248,16 @@ class _ModelHandler:
242
248
  related_model_name = None
243
249
  related_schema_name = None
244
250
  related_field_name = None
245
- field_name = field.name
251
+ is_editable = field.editable
246
252
  else:
247
253
  related_model_name = field.related_model._meta.model_name
248
254
  related_schema_name = field.related_model.__get_module_name__()
249
255
  schema_name = field.model.__get_module_name__()
250
256
  related_field_name = field.remote_field.name
251
- field_name = field.name
257
+ is_editable = False
258
+
259
+ field_name = field.name
260
+ is_primary_key = getattr(field, "primary_key", False)
252
261
 
253
262
  if relation_type in ["one-to-many"]:
254
263
  # For a one-to-many relation, the field belong
@@ -278,6 +287,8 @@ class _ModelHandler:
278
287
  field_name=field_name,
279
288
  type=internal_type,
280
289
  is_link_table=issubclass(field.model, LinkORM),
290
+ is_primary_key=is_primary_key,
291
+ is_editable=is_editable,
281
292
  column_name=column,
282
293
  relation_type=relation_type,
283
294
  related_schema_name=related_schema_name
@@ -125,7 +125,13 @@ class AWSOptionsManager:
125
125
 
126
126
  def enrich_path(self, path: UPath, access_token: str | None = None) -> UPath:
127
127
  # ignore paths with non-lamin-managed endpoints
128
- if path.storage_options.get("endpoint_url", None) not in LAMIN_ENDPOINTS:
128
+ if (
129
+ endpoint_url := path.storage_options.get("endpoint_url", None)
130
+ ) not in LAMIN_ENDPOINTS:
131
+ if "r2.cloudflarestorage.com" in endpoint_url:
132
+ # fixed_upload_size should always be True for R2
133
+ # this option is needed for correct uploads to R2
134
+ path = UPath(path, fixed_upload_size=True)
129
135
  return path
130
136
  # trailing slash is needed to avoid returning incorrect results
131
137
  # with .startswith
@@ -34,7 +34,6 @@ def private_django_api(reverse=False):
34
34
  # the order here matters
35
35
  # changing it might break the tests
36
36
  attributes = [
37
- "DoesNotExist",
38
37
  "MultipleObjectsReturned",
39
38
  "add_to_class",
40
39
  "adelete",
@@ -72,10 +71,6 @@ def private_django_api(reverse=False):
72
71
  new_name = attr if reverse else f"_{attr}"
73
72
  content = content.replace(old_name, new_name)
74
73
 
75
- if not reverse:
76
- content = content.replace("Field_DoesNotExist", "FieldDoesNotExist")
77
- content = content.replace("Object_DoesNotExist", "ObjectDoesNotExist")
78
-
79
74
  if content != original_content:
80
75
  file_path.write_text(content, encoding=encoding)
81
76
 
@@ -517,7 +517,7 @@ def modified(self) -> datetime | None:
517
517
 
518
518
 
519
519
  def compute_file_tree(
520
- path: Path,
520
+ path: UPath,
521
521
  *,
522
522
  level: int = -1,
523
523
  only_dirs: bool = False,
@@ -526,6 +526,11 @@ def compute_file_tree(
526
526
  include_paths: set[Any] | None = None,
527
527
  skip_suffixes: list[str] | None = None,
528
528
  ) -> tuple[str, int]:
529
+ # .exists() helps to separate files from folders for gcsfs
530
+ # otherwise sometimes it has is_dir() True and is_file() True
531
+ if path.protocol == "gs" and not path.exists():
532
+ raise FileNotFoundError
533
+
529
534
  space = " "
530
535
  branch = "│ "
531
536
  tee = "├── "
@@ -28,8 +28,8 @@ def lint(session: nox.Session) -> None:
28
28
  )
29
29
  def install(session: nox.Session, group: str) -> None:
30
30
  no_deps_packages = "git+https://github.com/laminlabs/lamindb git+https://github.com/laminlabs/wetlab git+https://github.com/laminlabs/lamin-cli"
31
- modules_deps = f"""uv pip install --system git+https://github.com/laminlabs/bionty
32
- uv pip install --system --no-deps {no_deps_packages}
31
+ modules_deps = f"""uv pip install --system --no-deps {no_deps_packages}
32
+ uv pip install --system git+https://github.com/laminlabs/bionty
33
33
  """
34
34
  if group == "hub-cloud":
35
35
  cmds = (
@@ -44,7 +44,7 @@ uv pip install --system --no-deps {no_deps_packages}
44
44
  # cmds += "uv pip install --system -e ./django\n"
45
45
  cmds = ""
46
46
  cmds += modules_deps.strip()
47
- cmds += """\nuv pip install --system huggingface_hub"""
47
+ cmds += """\nuv pip install --system gcsfs huggingface_hub"""
48
48
  elif group == "hub-local":
49
49
  cmds = modules_deps.strip()
50
50
  # current package
@@ -42,7 +42,7 @@ def test_edge_request():
42
42
  assert instance["lnid"] == hash_and_encode_as_b62(UUID(instance["id"]).hex)[:12]
43
43
  assert instance["owner"] == "laminlabs"
44
44
  assert instance["name"] == "lamindata"
45
- assert instance["api_url"] == "https://us-east-1.api.lamin.ai"
45
+ assert instance["api_url"] == "https://aws.us-east-1.lamin.ai/api"
46
46
  assert instance["schema_str"].startswith("bionty,wetlab")
47
47
  assert "schema_id" in instance
48
48
  # check that schema_id is well-formed UUID
@@ -41,6 +41,9 @@ def test_update_schema_in_hub(setup_instance):
41
41
  assert "bionty" in schema["schema_json"]
42
42
  assert "wetlab" in schema["schema_json"]
43
43
 
44
+ assert not schema["schema_json"]["core"]["artifact"]["is_link_table"]
45
+ assert schema["schema_json"]["core"]["artifactulabel"]["is_link_table"]
46
+
44
47
  assert schema["schema_json"]["core"]["artifact"]["fields"]["id"] == {
45
48
  "type": "AutoField",
46
49
  "column_name": "id",
@@ -49,6 +52,8 @@ def test_update_schema_in_hub(setup_instance):
49
52
  "model_name": "artifact",
50
53
  "schema_name": "core",
51
54
  "is_link_table": False,
55
+ "is_primary_key": True,
56
+ "is_editable": True, # Primary key are read-only even if is_editable is True
52
57
  "relation_type": None,
53
58
  "related_field_name": None,
54
59
  "related_model_name": None,
@@ -63,6 +68,8 @@ def test_update_schema_in_hub(setup_instance):
63
68
  "model_name": "artifact",
64
69
  "schema_name": "core",
65
70
  "is_link_table": False,
71
+ "is_primary_key": False,
72
+ "is_editable": False,
66
73
  "relation_type": None,
67
74
  "related_field_name": None,
68
75
  "related_model_name": None,
@@ -81,6 +88,8 @@ def test_update_schema_in_hub(setup_instance):
81
88
  "model_name": "artifact",
82
89
  "schema_name": "core",
83
90
  "is_link_table": False,
91
+ "is_primary_key": False,
92
+ "is_editable": False,
84
93
  "relation_type": "many-to-one",
85
94
  "related_field_name": "created_artifacts",
86
95
  "related_model_name": "user",
@@ -99,6 +108,8 @@ def test_update_schema_in_hub(setup_instance):
99
108
  "model_name": "gene",
100
109
  "schema_name": "bionty",
101
110
  "is_link_table": False,
111
+ "is_primary_key": False,
112
+ "is_editable": False,
102
113
  "relation_type": "many-to-many",
103
114
  "related_field_name": "genes",
104
115
  "related_model_name": "pathway",
@@ -117,6 +128,8 @@ def test_update_schema_in_hub(setup_instance):
117
128
  "model_name": "well",
118
129
  "schema_name": "wetlab",
119
130
  "is_link_table": False,
131
+ "is_primary_key": False,
132
+ "is_editable": False,
120
133
  "relation_type": "many-to-many",
121
134
  "related_field_name": "wells",
122
135
  "related_model_name": "artifact",
@@ -135,6 +148,8 @@ def test_update_schema_in_hub(setup_instance):
135
148
  "model_name": "transform",
136
149
  "schema_name": "core",
137
150
  "is_link_table": False,
151
+ "is_primary_key": False,
152
+ "is_editable": False,
138
153
  "relation_type": "many-to-many",
139
154
  "related_field_name": "successors",
140
155
  "related_model_name": "transform",
@@ -153,6 +168,8 @@ def test_update_schema_in_hub(setup_instance):
153
168
  "model_name": "transform",
154
169
  "schema_name": "core",
155
170
  "is_link_table": False,
171
+ "is_primary_key": False,
172
+ "is_editable": False,
156
173
  "relation_type": "many-to-many",
157
174
  "related_field_name": "predecessors",
158
175
  "related_model_name": "transform",
@@ -6,6 +6,11 @@ import pytest
6
6
  from lamindb_setup.core.upath import ProgressCallback, UPath, create_path
7
7
 
8
8
 
9
+ def test_view_tree():
10
+ with pytest.raises(FileNotFoundError):
11
+ UPath("gs://no-such-bucket-surely-145/folder").view_tree()
12
+
13
+
9
14
  def test_trailing_slash():
10
15
  assert UPath("s3://bucket/key/").path[-1] != "/"
11
16
  assert (UPath("s3://bucket/") / "key/").path[-1] != "/"
@@ -51,6 +56,10 @@ def test_create_path():
51
56
  upath = create_path("http://some_url.com/")
52
57
  assert upath.storage_options["use_listings_cache"]
53
58
  assert "timeout" in upath.storage_options["client_kwargs"]
59
+ # test R2
60
+ upath = create_path("s3://bucket/key?endpoint_url=https://r2.cloudflarestorage.com")
61
+ assert upath.as_posix() == "s3://bucket/key"
62
+ assert upath.storage_options["fixed_upload_size"]
54
63
 
55
64
 
56
65
  def test_progress_callback_size():
File without changes
File without changes
File without changes