-
Notifications
You must be signed in to change notification settings - Fork 3
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
✨ Kf id prefix #135
✨ Kf id prefix #135
Conversation
aa36bc8
to
444e6ef
Compare
14f2a1c
to
6bea2d9
Compare
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.
looks good to me. kf_id needs update in newly merged family_relationship model.
5cb61dc
to
8dce359
Compare
dataservice/api/README.md
Outdated
and seperated by an underscore. | ||
Some examples: | ||
|
||
- `PH_CZHXGVPB` |
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.
Minor nitpick..should we make the examples a little more clear here. So something like:
PH_CZHXGVPB
(Phenotype entity)
dataservice/api/common/id_service.py
Outdated
@@ -10,15 +10,26 @@ def uuid_generator(): | |||
return str(uuid.uuid4()) | |||
|
|||
|
|||
def kf_id_generator(): | |||
def kf_id_generator(prefix=None): |
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.
Why not make prefix a required argument since it cannot be None as indicated by the assert below?
dataservice/api/common/model.py
Outdated
|
||
@declared_attr | ||
def kf_id(cls): | ||
kf_id = db.Column(KfId(), unique=True, primary_key=True, |
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.
Remove unique = True
since this is a primary key and we're going to wipe out migrations
dataservice/api/common/model.py
Outdated
default=kf_id_generator(cls.__prefix__)) | ||
return kf_id | ||
|
||
uuid = db.Column(db.String(36), unique=True, default=uuid_generator) |
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.
Why aren't we using Postgres UUID?
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.
👍 Bad merge
fe3c4ad
to
2ded275
Compare
c04702e
to
4ed5261
Compare
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.
👍
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.
👍
Adds a two-character prefix per table on the kf_id delimited by an underscore.
Resolves #127