-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: persistence layer clean-up #3835
Merged
+244
−252
Merged
Changes from 16 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e3303dd
refactor: persistence layer clean-up
nayib-jose-gloria e21c59f
lint
nayib-jose-gloria 04668e6
update missing id changes
nayib-jose-gloria 3b2f18d
lint fix
nayib-jose-gloria 04c4dc1
more missing id's
nayib-jose-gloria ad3a3c5
Merge branch 'main' into nayib/persistence-layer-clean-up
nayib-jose-gloria 6ba491e
remove unused import
nayib-jose-gloria 4332f63
correct id name
nayib-jose-gloria bc0cceb
Merge branch 'nayib/persistence-layer-clean-up' of https://github.com…
nayib-jose-gloria b6184b9
lint fix
nayib-jose-gloria 006d4ff
id fix
nayib-jose-gloria d8e4f17
id fix
nayib-jose-gloria 719705b
more ids
nayib-jose-gloria b938f1f
id fix
nayib-jose-gloria 60c2c07
version id fix
nayib-jose-gloria e7f2e94
lint fix
nayib-jose-gloria b8a1dbb
Merge branch 'main' of https://github.com/chanzuckerberg/single-cell-…
nayib-jose-gloria 26cf547
autogenerate migration script for db field changes + update README links
nayib-jose-gloria 3f198ab
update makefile test command documentation
nayib-jose-gloria f9a8f95
pr feedback on docs
nayib-jose-gloria f601d68
update migration script + db/local/load-schema + migration docs
nayib-jose-gloria 5ca9ef6
lint fixes
nayib-jose-gloria eef29f0
remove unused imports
nayib-jose-gloria df789da
Merge branch 'main' into nayib/persistence-layer-clean-up
nayib-jose-gloria 96d515c
Merge branch 'main' into nayib/persistence-layer-clean-up
nayib-jose-gloria 4872b0a
tabs
nayib-jose-gloria 5972945
Merge branch 'nayib/persistence-layer-clean-up' of https://github.com…
nayib-jose-gloria 31218bc
tabs
nayib-jose-gloria File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
from enum import Enum | ||
from typing import List, Optional | ||
|
||
import uuid | ||
|
||
from dataclasses_json import dataclass_json | ||
|
||
|
||
|
@@ -98,43 +100,34 @@ def empty(): | |
|
||
|
||
@dataclass | ||
class CollectionId: | ||
class EntityId: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great idea. I initially went for the same approach but I discarded it (but I can't remember the reason - maybe something with dataclasses?). Anyway if it works this is certainly great. |
||
id: str | ||
|
||
def __repr__(self) -> str: | ||
return self.id | ||
|
||
|
||
@dataclass | ||
class CollectionVersionId: | ||
id: str | ||
def __init__(self, entity_id: str = None): | ||
self.id = str(entity_id) if entity_id is not None else str(uuid.uuid4()) | ||
|
||
def __repr__(self) -> str: | ||
return self.id | ||
|
||
|
||
@dataclass | ||
class DatasetId: | ||
id: str | ||
class CollectionId(EntityId): | ||
pass | ||
|
||
def __repr__(self) -> str: | ||
return self.id | ||
|
||
class CollectionVersionId(EntityId): | ||
pass | ||
|
||
@dataclass | ||
class DatasetVersionId: | ||
id: str | ||
|
||
def __repr__(self) -> str: | ||
return self.id | ||
class DatasetId(EntityId): | ||
pass | ||
|
||
|
||
@dataclass | ||
class DatasetArtifactId: | ||
id: str | ||
class DatasetVersionId(EntityId): | ||
pass | ||
|
||
def __repr__(self) -> str: | ||
return self.id | ||
|
||
class DatasetArtifactId(EntityId): | ||
pass | ||
|
||
|
||
@dataclass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run [backend] functional tests
?