pierrejeambrun commented on code in PR #66008:
URL: https://github.com/apache/airflow/pull/66008#discussion_r3153384795
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_task_instances.py:
##########
@@ -871,37 +875,49 @@ def test_mapped_instances_order(
assert len(body["task_instances"]) == min(params["limit"],
conf.getint("api", "maximum_page_limit"))
assert expected_map_indexes == [ti["map_index"] for ti in
body["task_instances"]]
- # Ordering of nulls values is DB specific.
- @pytest.mark.backend("sqlite")
@pytest.mark.parametrize(
- ("params", "expected_map_indexes"),
+ ("param_value", "expected_map_indexes"),
[
- ({"order_by": "rendered_map_index", "limit": 108}, list(range(1,
109))), # Asc
- ({"order_by": "-rendered_map_index", "limit": 100}, [0] +
list(range(11, 110)[::-1])), # Desc
+ (["table_orders"], [0]),
+ (["table_orders", "metrics_daily"], [0, 2]),
+ (["table"], []),
+ (["nope"], []),
+ # Fallback to str(map_index) when _rendered_map_index is NULL.
+ (["7"], [7]),
+ (["7", "table_orders"], [0, 7]),
],
)
- @conf_vars({("api", "maximum_page_limit"): "110"})
- def test_rendered_map_index_order(
Review Comment:
Not needed anymore. WIth the hybrid expression part, now defaults to
'map_index' if null. Won't be null for mapped indexes, this test isn't
relevant. (testing null ordering, but the field isn't null anymore) Can remain
null for non mapped TI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]