Skip to content

Commit b5cea3a

Browse files
authored
Merge pull request #62 from openedx/bmtcril/fix_block_csv_order
Fix course block CSV ordering
2 parents 6eab1af + 52d684c commit b5cea3a

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ Change Log
1414
Unreleased
1515
**********
1616

17+
0.9.7 - 2024-06-14
18+
******************
19+
20+
Fixes
21+
=====
22+
23+
* 0.9.6 introduced a bug in the CourseOverview sink that caused block sink to fail to import to ClickHouse, this fixes it.
24+
25+
1726
0.9.6 - 2024-06-07
1827
******************
1928

platform_plugin_aspects/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
import os
66
from pathlib import Path
77

8-
__version__ = "0.9.6"
8+
__version__ = "0.9.7"
99

1010
ROOT_DIRECTORY = Path(os.path.dirname(os.path.abspath(__file__)))

platform_plugin_aspects/sinks/course_overview_sink.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ def serialize_xblock(self, item, detached_xblock_types, dump_id, time_last_dumpe
184184
"location": str(XBlockSink.strip_branch_and_version(item.location)),
185185
"display_name": item.display_name_with_default.replace("'", "'"),
186186
"xblock_data_json": json_data,
187+
# We need to add this here so the key will be in the right place
188+
# in the generated csv
189+
"order": -1,
187190
"edited_on": str(getattr(item, "edited_on", "")),
188191
"dump_id": dump_id,
189192
"time_last_dumped": time_last_dumped,

test_utils/helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,10 @@ def match(request):
379379
assert block_json_data["course"] == csv_json["course"]
380380
assert block_json_data["run"] == csv_json["run"]
381381
assert block_json_data["block_type"] == csv_json["block_type"]
382+
383+
# The order sent here should match our block order, but starts at 1
382384
i += 1
385+
assert row[5] == str(i)
383386
except AssertionError as e:
384387
return False, f"Mismatch in row {i}: {e}"
385388
return True, ""

0 commit comments

Comments
 (0)