Skip to content

Commit

Permalink
Cleaner way to extract only lineage_names
Browse files Browse the repository at this point in the history
  • Loading branch information
Shettland committed Dec 20, 2024
1 parent 2a3eb44 commit bc6e657
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions core/utils/lineage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@

def get_lineages_list():
"""Function gets the lineage names and return then in an ordered list"""
latest_schema = core.utils.schema.get_default_schema()
lineage_name_field_id = core.models.LineageFields.objects.filter(
schemaID=latest_schema
).first()
return list(
core.models.LineageValues.objects.all()
.filter(lineage_fieldID=lineage_name_field_id)
.filter(lineage_fieldID__property_name__iexact="lineage_name")
.values_list("value", flat=True)
.distinct()
.order_by("value")
Expand Down

0 comments on commit bc6e657

Please sign in to comment.