Skip to content

Commit 05038c0

Browse files
committed
Formatting
1 parent eb7e44e commit 05038c0

File tree

3 files changed

+26
-78
lines changed

3 files changed

+26
-78
lines changed

src/amp/registry/datasets.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,7 @@ def update_visibility(self, namespace: str, name: str, visibility: str) -> model
371371
response = self._registry._request('PATCH', path, json=body)
372372
return models.Dataset.model_validate(response.json())
373373

374-
def update_version_status(
375-
self, namespace: str, name: str, version: str, status: str
376-
) -> models.DatasetVersion:
374+
def update_version_status(self, namespace: str, name: str, version: str, status: str) -> models.DatasetVersion:
377375
"""Update the status of a dataset version.
378376
379377
Requires authentication and ownership of the dataset.

src/amp/registry/models.py

Lines changed: 24 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ class ManifestKind(Enum):
115115
class ManifestTag(BaseModel):
116116
created_at: Annotated[
117117
str,
118-
Field(
119-
description='Timestamp when the ManifestTag record was created (immutable).'
120-
),
118+
Field(description='Timestamp when the ManifestTag record was created (immutable).'),
121119
]
122120
dataset_reference: Annotated[
123121
str,
@@ -231,27 +229,13 @@ class UpdateDatasetMetadataDto(BaseModel):
231229
- description
232230
"""
233231

234-
description: Annotated[Optional[str], Field(description='Dataset description')] = (
235-
None
236-
)
237-
indexing_chains: Annotated[
238-
list[str], Field(description='Chains being indexed by the dataset')
239-
]
240-
keywords: Annotated[
241-
Optional[list[str]], Field(description='Keywords for dataset discovery')
242-
] = None
243-
license: Annotated[
244-
Optional[str], Field(description='License covering the dataset')
245-
] = None
246-
readme: Annotated[
247-
Optional[str], Field(description='User-defined README for the dataset')
248-
] = None
249-
repository_url: Annotated[
250-
Optional[str], Field(description='VCS repository URL')
251-
] = None
252-
source: Annotated[
253-
Optional[list[str]], Field(description='Source of data being materialized')
254-
] = None
232+
description: Annotated[Optional[str], Field(description='Dataset description')] = None
233+
indexing_chains: Annotated[list[str], Field(description='Chains being indexed by the dataset')]
234+
keywords: Annotated[Optional[list[str]], Field(description='Keywords for dataset discovery')] = None
235+
license: Annotated[Optional[str], Field(description='License covering the dataset')] = None
236+
readme: Annotated[Optional[str], Field(description='User-defined README for the dataset')] = None
237+
repository_url: Annotated[Optional[str], Field(description='VCS repository URL')] = None
238+
source: Annotated[Optional[list[str]], Field(description='Source of data being materialized')] = None
255239

256240

257241
class UpdateDatasetVersionStatusDto(BaseModel):
@@ -272,9 +256,7 @@ class UpdateDatasetVisibilityDto(BaseModel):
272256
Input for updating a Dataset's visibility
273257
"""
274258

275-
visibility: Annotated[
276-
DatasetVisibility, Field(description='The new visibility level for the dataset')
277-
]
259+
visibility: Annotated[DatasetVisibility, Field(description='The new visibility level for the dataset')]
278260

279261

280262
class DatasetVersion(BaseModel):
@@ -315,9 +297,7 @@ class DatasetVersion(BaseModel):
315297
]
316298
descendants: Annotated[
317299
Optional[list[DatasetVersionAncestry]],
318-
Field(
319-
description='Array of descendant DatasetVersion references that extend from this version.'
320-
),
300+
Field(description='Array of descendant DatasetVersion references that extend from this version.'),
321301
] = None
322302
status: DatasetVersionStatus
323303
version_tag: Annotated[
@@ -414,9 +394,7 @@ class DatasetWithScore(BaseModel):
414394
Optional[str],
415395
Field(
416396
description='User-defined README for the Dataset providing usage examples and documentation.',
417-
examples=[
418-
'# ETH Transfers\\n\\nThis dataset indexes all Ethereum transfers...'
419-
],
397+
examples=['# ETH Transfers\\n\\nThis dataset indexes all Ethereum transfers...'],
420398
),
421399
] = None
422400
repository_url: Annotated[
@@ -449,9 +427,7 @@ class DatasetWithScore(BaseModel):
449427
]
450428
versions: Annotated[
451429
Optional[list[DatasetVersion]],
452-
Field(
453-
description='Link to all DatasetVersion records that this Dataset is a parent of.'
454-
),
430+
Field(description='Link to all DatasetVersion records that this Dataset is a parent of.'),
455431
] = None
456432
visibility: DatasetVisibility
457433

@@ -506,9 +482,7 @@ class Manifest(BaseModel):
506482
str,
507483
Field(
508484
description='The SHA256 unique hash that represents that Manifest JSON content.',
509-
examples=[
510-
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
511-
],
485+
examples=['e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'],
512486
pattern='^[0-9a-fA-F]{64}$',
513487
),
514488
]
@@ -607,9 +581,7 @@ class Dataset(BaseModel):
607581
Optional[str],
608582
Field(
609583
description='User-defined README for the Dataset providing usage examples and documentation.',
610-
examples=[
611-
'# ETH Transfers\n\nThis dataset indexes all Ethereum transfers...'
612-
],
584+
examples=['# ETH Transfers\n\nThis dataset indexes all Ethereum transfers...'],
613585
),
614586
] = None
615587
repository_url: Annotated[
@@ -635,9 +607,7 @@ class Dataset(BaseModel):
635607
]
636608
versions: Annotated[
637609
Optional[list[DatasetVersion]],
638-
Field(
639-
description='Link to all DatasetVersion records that this Dataset is a parent of.'
640-
),
610+
Field(description='Link to all DatasetVersion records that this Dataset is a parent of.'),
641611
] = None
642612
visibility: DatasetVisibility
643613

@@ -650,25 +620,17 @@ class DatasetListResponse(BaseModel):
650620
list[Dataset],
651621
Field(description='List of the datasets being returned in this page'),
652622
]
653-
has_next_page: Annotated[
654-
bool, Field(description='If true, there are more datasets that can be fetched')
655-
]
656-
total_count: Annotated[
657-
int, Field(description='Total number of datasets matching the query filters')
658-
]
623+
has_next_page: Annotated[bool, Field(description='If true, there are more datasets that can be fetched')]
624+
total_count: Annotated[int, Field(description='Total number of datasets matching the query filters')]
659625

660626

661627
class DatasetSearchResponse(BaseModel):
662628
datasets: Annotated[
663629
list[DatasetWithScore],
664630
Field(description='List of the datasets being returned in this page'),
665631
]
666-
has_next_page: Annotated[
667-
bool, Field(description='If true, there are more datasets that can be fetched')
668-
]
669-
total_count: Annotated[
670-
int, Field(description='Total number of datasets matching the query filters')
671-
]
632+
has_next_page: Annotated[bool, Field(description='If true, there are more datasets that can be fetched')]
633+
total_count: Annotated[int, Field(description='Total number of datasets matching the query filters')]
672634

673635

674636
class InsertDataset(BaseModel):
@@ -727,9 +689,7 @@ class InsertDataset(BaseModel):
727689
Optional[str],
728690
Field(
729691
description='User-defined README for the Dataset providing usage examples and documentation.',
730-
examples=[
731-
'# ETH Transfers\\n\\nThis dataset indexes all Ethereum transfers...'
732-
],
692+
examples=['# ETH Transfers\\n\\nThis dataset indexes all Ethereum transfers...'],
733693
),
734694
] = None
735695
repository_url: Annotated[
@@ -756,25 +716,17 @@ class OwnerDatasetListResponse(BaseModel):
756716
list[Dataset],
757717
Field(description='List of the datasets being returned in this page'),
758718
]
759-
has_next_page: Annotated[
760-
bool, Field(description='If true, there are more datasets that can be fetched')
761-
]
762-
total_count: Annotated[
763-
int, Field(description='Total number of datasets matching the query filters')
764-
]
719+
has_next_page: Annotated[bool, Field(description='If true, there are more datasets that can be fetched')]
720+
total_count: Annotated[int, Field(description='Total number of datasets matching the query filters')]
765721

766722

767723
class AuthUserOwnedDatasetListResponse(BaseModel):
768724
datasets: Annotated[
769725
list[Dataset],
770726
Field(description='List of the datasets being returned in this page'),
771727
]
772-
has_next_page: Annotated[
773-
bool, Field(description='If true, there are more datasets that can be fetched')
774-
]
775-
total_count: Annotated[
776-
int, Field(description='Total number of datasets matching the query filters')
777-
]
728+
has_next_page: Annotated[bool, Field(description='If true, there are more datasets that can be fetched')]
729+
total_count: Annotated[int, Field(description='Total number of datasets matching the query filters')]
778730

779731

780732
ManifestTag.model_rebuild()

tests/integration/registry/test_datasets.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ def test_get_version(self, registry_client):
129129
pytest.skip('No versions available for dataset')
130130

131131
# Get specific version
132-
version_detail = registry_client.datasets.get_version(
133-
dataset.namespace, dataset.name, versions[0].version_tag
134-
)
132+
version_detail = registry_client.datasets.get_version(dataset.namespace, dataset.name, versions[0].version_tag)
135133

136134
assert version_detail.version_tag == versions[0].version_tag
137135
assert version_detail.status

0 commit comments

Comments
 (0)