Skip to content

Commit ad876c1

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Fix logic that checks if ground truths are present
1 parent 9dde9f2 commit ad876c1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

openlayer/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,6 +1984,9 @@ def publish_batch_data(
19841984
"Make sure to fix all of the issues listed above before the upload.",
19851985
) from None
19861986

1987+
# Check if batch of data contains ground truths
1988+
contains_ground_truths = self._contains_ground_truths(batch_config=batch_data)
1989+
19871990
# Load dataset config and augment with defaults
19881991
batch_data = DatasetSchema().load(
19891992
{"task_type": task_type.value, **batch_config}
@@ -1999,15 +2002,13 @@ def publish_batch_data(
19992002
# Get min and max timestamps
20002003
earliest_timestamp = batch_df[batch_data["timestampColumnName"]].min()
20012004
latest_timestamp = batch_df[batch_data["timestampColumnName"]].max()
2002-
# Check if batch of data contains ground truths
2003-
contains_ground_truths = self._contains_ground_truths(batch_config=batch_data)
20042005

20052006
with tempfile.TemporaryDirectory() as tmp_dir:
20062007
# Copy save files to tmp dir
20072008
batch_df.to_csv(f"{tmp_dir}/dataset.csv", index=False)
20082009
payload = {
2009-
"earliestTimestamp": earliest_timestamp,
2010-
"latestTimestamp": latest_timestamp,
2010+
"earliestTimestamp": int(earliest_timestamp),
2011+
"latestTimestamp": int(latest_timestamp),
20112012
"performGroundTruthMerge": not contains_ground_truths,
20122013
**batch_data,
20132014
}

0 commit comments

Comments
 (0)