MCPcopy Index your code
hub / github.com/diffgram/diffgram / get_by_highest_number

Method get_by_highest_number

shared/database/video/sequence.py:116–138  ·  view source on GitHub ↗

Assumes we don't know the sequence id in question And need the highest, ie in the context of adding a new sequence from a source that was not previously tracking the highest number. ie for updating the label file

(
        session,
        video_file_id: int,
        label_file_id: int,
        archived = False
    )

Source from the content-addressed store, hash-verified

114
115 @staticmethod
116 def get_by_highest_number(
117 session,
118 video_file_id: int,
119 label_file_id: int,
120 archived = False
121 ):
122 """
123 Assumes we don't know the sequence id in question
124 And need the highest, ie in the context of adding a new
125 sequence from a source that was not previously tracking
126 the highest number.
127 ie for updating the label file
128
129 """
130
131 query = session.query(Sequence).filter(
132 Sequence.video_file_id == video_file_id,
133 Sequence.label_file_id == label_file_id,
134 Sequence.archived == archived)
135
136 query.order_by(Sequence.number)
137
138 return query.first()
139
140 def serialize(self, session = None):
141

Callers 1

update_sequence_sharedFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected