diff --git a/CHANGES b/CHANGES index c6b94f00..782c4ddf 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +main +==== +restore support for Python 3.8, 3.9 +(reinstated some Data API functionalities being tested after the API got patched re: sorting on PK and pagination with that sorting) + v 2.0.0-preview =============== Introduction of full Tables support. diff --git a/tests/tables/conftest.py b/tests/tables/conftest.py index 84b5c451..350beb72 100644 --- a/tests/tables/conftest.py +++ b/tests/tables/conftest.py @@ -134,9 +134,6 @@ dimension=3, service=None, ), - "p_int_regular": TableScalarColumnTypeDescriptor( - column_type="int" - ), # TODO: remove->p_int after #1718 }, primary_key=TablePrimaryKeyDescriptor( partition_by=["p_text"], diff --git a/tests/tables/integration/test_table_dml_async.py b/tests/tables/integration/test_table_dml_async.py index 1467f603..aa79b58b 100644 --- a/tests/tables/integration/test_table_dml_async.py +++ b/tests/tables/integration/test_table_dml_async.py @@ -25,7 +25,6 @@ from astrapy.results import TableInsertManyResult from ..conftest import ( - IS_ASTRA_DB, DefaultAsyncTable, _repaint_NaNs, _typify_tuple, @@ -98,7 +97,6 @@ async def test_table_insert_one_find_one_async( { "p_text": "pA", "p_int": i, - "p_int_regular": i, "p_vector": DataAPIVector([i, 1, 0]), } for i in range(3) @@ -109,7 +107,6 @@ async def test_table_insert_one_find_one_async( { "p_text": "pB", "p_int": 100 - i, - "p_int_regular": 100 - i, "p_vector": DataAPIVector([i + 0.1, 1, 0]), } for i in range(3) @@ -129,18 +126,14 @@ async def test_table_insert_one_find_one_async( assert (fo_fil_ann_row["p_text"], fo_fil_ann_row["p_int"]) == ("pB", 100) # just regular sort fo_unf_srt_row = await async_empty_table_composite.find_one( - sort={ - "p_int_regular": SortMode.DESCENDING - } # TODO: replace with p_int when ok + sort={"p_int": SortMode.DESCENDING} ) assert fo_unf_srt_row is not None assert (fo_unf_srt_row["p_text"], fo_unf_srt_row["p_int"]) == ("pB", 100) # regular sort, filtered fo_fil_srt_row = await async_empty_table_composite.find_one( filter={"p_text": "pA"}, - sort={ - "p_int_regular": SortMode.DESCENDING - }, # TODO: replace with p_int when ok + sort={"p_int": SortMode.DESCENDING}, ) assert fo_fil_srt_row is not None assert (fo_fil_srt_row["p_text"], fo_fil_srt_row["p_int"]) == ("pA", 2) @@ -636,26 +629,14 @@ async def test_table_find_async( # (nonvector) sorting await async_empty_table_all_returns.insert_many(INSMANY_AR_ROWS) # sorting as per clustering column - if IS_ASTRA_DB: # TODO, reinstate full find once fix deployed - # (i.e. remove this branching point in favour of local) - srows_in_part = await async_empty_table_all_returns.find( - filter={"p_ascii": "A", "p_bigint": 100}, - sort={"p_int": SortMode.DESCENDING}, - limit=20, - ).to_list() - assert len(srows_in_part) == 20 - srows_in_part_pints = [row["p_int"] for row in srows_in_part] - assert sorted(srows_in_part_pints) == srows_in_part_pints[::-1] - else: - # Latest Data API: - srows_in_part = await async_empty_table_all_returns.find( - filter={"p_ascii": "A", "p_bigint": 100}, - sort={"p_int": SortMode.DESCENDING}, - limit=INSMANY_AR_ROW_HALFN + 1, - ).to_list() - assert len(srows_in_part) == INSMANY_AR_ROW_HALFN - srows_in_part_pints = [row["p_int"] for row in srows_in_part] - assert sorted(srows_in_part_pints) == srows_in_part_pints[::-1] + srows_in_part = await async_empty_table_all_returns.find( + filter={"p_ascii": "A", "p_bigint": 100}, + sort={"p_int": SortMode.DESCENDING}, + limit=INSMANY_AR_ROW_HALFN + 1, + ).to_list() + assert len(srows_in_part) == INSMANY_AR_ROW_HALFN + srows_in_part_pints = [row["p_int"] for row in srows_in_part] + assert sorted(srows_in_part_pints) == srows_in_part_pints[::-1] # sorting by any regular column srows_anycol = await async_empty_table_all_returns.find( filter={"p_ascii": "A", "p_bigint": 100}, diff --git a/tests/tables/integration/test_table_dml_sync.py b/tests/tables/integration/test_table_dml_sync.py index a14f7ccc..437937e1 100644 --- a/tests/tables/integration/test_table_dml_sync.py +++ b/tests/tables/integration/test_table_dml_sync.py @@ -25,7 +25,6 @@ from astrapy.results import TableInsertManyResult from ..conftest import ( - IS_ASTRA_DB, DefaultTable, _repaint_NaNs, _typify_tuple, @@ -98,7 +97,6 @@ def test_table_insert_one_find_one_sync( { "p_text": "pA", "p_int": i, - "p_int_regular": i, "p_vector": DataAPIVector([i, 1, 0]), } for i in range(3) @@ -109,7 +107,6 @@ def test_table_insert_one_find_one_sync( { "p_text": "pB", "p_int": 100 - i, - "p_int_regular": 100 - i, "p_vector": DataAPIVector([i + 0.1, 1, 0]), } for i in range(3) @@ -129,18 +126,14 @@ def test_table_insert_one_find_one_sync( assert (fo_fil_ann_row["p_text"], fo_fil_ann_row["p_int"]) == ("pB", 100) # just regular sort fo_unf_srt_row = sync_empty_table_composite.find_one( - sort={ - "p_int_regular": SortMode.DESCENDING - } # TODO: replace with p_int when ok + sort={"p_int": SortMode.DESCENDING} ) assert fo_unf_srt_row is not None assert (fo_unf_srt_row["p_text"], fo_unf_srt_row["p_int"]) == ("pB", 100) # regular sort, filtered fo_fil_srt_row = sync_empty_table_composite.find_one( filter={"p_text": "pA"}, - sort={ - "p_int_regular": SortMode.DESCENDING - }, # TODO: replace with p_int when ok + sort={"p_int": SortMode.DESCENDING}, ) assert fo_fil_srt_row is not None assert (fo_fil_srt_row["p_text"], fo_fil_srt_row["p_int"]) == ("pA", 2) @@ -622,26 +615,14 @@ def test_table_find_sync( # (nonvector) sorting sync_empty_table_all_returns.insert_many(INSMANY_AR_ROWS) # sorting as per clustering column - if IS_ASTRA_DB: # TODO, reinstate full find once fix deployed - # (i.e. remove this branching point in favour of local) - srows_in_part = sync_empty_table_all_returns.find( - filter={"p_ascii": "A", "p_bigint": 100}, - sort={"p_int": SortMode.DESCENDING}, - limit=20, - ).to_list() - assert len(srows_in_part) == 20 - srows_in_part_pints = [row["p_int"] for row in srows_in_part] - assert sorted(srows_in_part_pints) == srows_in_part_pints[::-1] - else: - # Latest Data API: - srows_in_part = sync_empty_table_all_returns.find( - filter={"p_ascii": "A", "p_bigint": 100}, - sort={"p_int": SortMode.DESCENDING}, - limit=INSMANY_AR_ROW_HALFN + 1, - ).to_list() - assert len(srows_in_part) == INSMANY_AR_ROW_HALFN - srows_in_part_pints = [row["p_int"] for row in srows_in_part] - assert sorted(srows_in_part_pints) == srows_in_part_pints[::-1] + srows_in_part = sync_empty_table_all_returns.find( + filter={"p_ascii": "A", "p_bigint": 100}, + sort={"p_int": SortMode.DESCENDING}, + limit=INSMANY_AR_ROW_HALFN + 1, + ).to_list() + assert len(srows_in_part) == INSMANY_AR_ROW_HALFN + srows_in_part_pints = [row["p_int"] for row in srows_in_part] + assert sorted(srows_in_part_pints) == srows_in_part_pints[::-1] # sorting by any regular column srows_anycol = sync_empty_table_all_returns.find( filter={"p_ascii": "A", "p_bigint": 100},