Skip to content
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

Merged
merged 5 commits into from
Feb 22, 2018
Merged

✨ Kf id prefix #135

merged 5 commits into from
Feb 22, 2018

Conversation

dankolbman
Copy link
Contributor

Adds a two-character prefix per table on the kf_id delimited by an underscore.

Resolves #127

@dankolbman dankolbman added feature New functionality data model Changes to the underlying data representation labels Feb 16, 2018
@dankolbman dankolbman self-assigned this Feb 16, 2018
@dankolbman dankolbman force-pushed the kf_id_prefix branch 2 times, most recently from aa36bc8 to 444e6ef Compare February 16, 2018 18:37
@dankolbman dankolbman changed the title Kf id prefix ✨Kf id prefix Feb 16, 2018
@dankolbman dankolbman force-pushed the kf_id_prefix branch 3 times, most recently from 14f2a1c to 6bea2d9 Compare February 19, 2018 15:15
Copy link
Contributor

@parimalak parimalak left a 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.

@baileyckelly baileyckelly added this to the CHOP Sprint 3 milestone Feb 19, 2018
@dankolbman dankolbman force-pushed the kf_id_prefix branch 4 times, most recently from 5cb61dc to 8dce359 Compare February 22, 2018 15:50
and seperated by an underscore.
Some examples:

- `PH_CZHXGVPB`
Copy link
Member

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)

@@ -10,15 +10,26 @@ def uuid_generator():
return str(uuid.uuid4())


def kf_id_generator():
def kf_id_generator(prefix=None):
Copy link
Member

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?


@declared_attr
def kf_id(cls):
kf_id = db.Column(KfId(), unique=True, primary_key=True,
Copy link
Member

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

default=kf_id_generator(cls.__prefix__))
return kf_id

uuid = db.Column(db.String(36), unique=True, default=uuid_generator)
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Bad merge

@dankolbman dankolbman force-pushed the kf_id_prefix branch 2 times, most recently from fe3c4ad to 2ded275 Compare February 22, 2018 16:32
Copy link
Member

@znatty22 znatty22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@znatty22 znatty22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dankolbman dankolbman merged commit cba9cc3 into master Feb 22, 2018
@dankolbman dankolbman deleted the kf_id_prefix branch February 22, 2018 18:32
@dankolbman dankolbman changed the title ✨Kf id prefix ✨ Kf id prefix Mar 9, 2018
@dankolbman dankolbman mentioned this pull request Apr 2, 2018
@dankolbman dankolbman removed the ready-for-review This PR needs a review label May 7, 2018
alubneuski pushed a commit that referenced this pull request Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data model Changes to the underlying data representation feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change IDs
4 participants