Skip to content

Commit 4e89d9a

Browse files
authored
GH-30774: [Python] Remove deprecated use_async (#34034)
Has been deprecated since Arrow 7.0.0, time to make things nice and clean: https://issues.apache.org/jira/browse/ARROW-13554 * Closes: #30774 Authored-by: Fokko Driesprong <fokko@tabular.io> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
1 parent 5c73ac8 commit 4e89d9a

2 files changed

Lines changed: 3 additions & 67 deletions

File tree

python/pyarrow/_dataset.pyx

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,9 +2437,6 @@ cdef class Scanner(_Weakrefable):
24372437
use_threads : bool, default True
24382438
If enabled, then maximum parallelism will be used determined by
24392439
the number of available CPU cores.
2440-
use_async : bool, default True
2441-
This flag is deprecated and is being kept for this release for
2442-
backwards compatibility. It will be removed in the next release.
24432440
memory_pool : MemoryPool, default None
24442441
For memory allocations, if required. If not specified, uses the
24452442
default pool.
@@ -2493,8 +2490,7 @@ cdef class Scanner(_Weakrefable):
24932490
int batch_readahead=_DEFAULT_BATCH_READAHEAD,
24942491
int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
24952492
FragmentScanOptions fragment_scan_options=None,
2496-
bint use_threads=True, object use_async=None,
2497-
MemoryPool memory_pool=None):
2493+
bint use_threads=True, MemoryPool memory_pool=None):
24982494
"""
24992495
Create Scanner from Dataset,
25002496
@@ -2544,10 +2540,6 @@ cdef class Scanner(_Weakrefable):
25442540
use_threads : bool, default True
25452541
If enabled, then maximum parallelism will be used determined by
25462542
the number of available CPU cores.
2547-
use_async : bool, default True
2548-
This flag is deprecated and is being kept for this release for
2549-
backwards compatibility. It will be removed in the next
2550-
release.
25512543
memory_pool : MemoryPool, default None
25522544
For memory allocations, if required. If not specified, uses the
25532545
default pool.
@@ -2557,11 +2549,6 @@ cdef class Scanner(_Weakrefable):
25572549
shared_ptr[CScannerBuilder] builder
25582550
shared_ptr[CScanner] scanner
25592551

2560-
if use_async is not None:
2561-
warnings.warn('The use_async flag is deprecated and has no '
2562-
'effect. It will be removed in the next release.',
2563-
FutureWarning)
2564-
25652552
options = Scanner._make_scan_options(
25662553
dataset,
25672554
dict(columns=columns, filter=filter, batch_size=batch_size,
@@ -2579,8 +2566,7 @@ cdef class Scanner(_Weakrefable):
25792566
int batch_size=_DEFAULT_BATCH_SIZE,
25802567
int batch_readahead=_DEFAULT_BATCH_READAHEAD,
25812568
FragmentScanOptions fragment_scan_options=None,
2582-
bint use_threads=True, object use_async=None,
2583-
MemoryPool memory_pool=None,):
2569+
bint use_threads=True, MemoryPool memory_pool=None,):
25842570
"""
25852571
Create Scanner from Fragment,
25862572
@@ -2629,20 +2615,12 @@ cdef class Scanner(_Weakrefable):
26292615
use_threads : bool, default True
26302616
If enabled, then maximum parallelism will be used determined by
26312617
the number of available CPU cores.
2632-
use_async : bool, default True
2633-
This flag is deprecated and is being kept for this release for
2634-
backwards compatibility. It will be removed in the next
2635-
release.
26362618
memory_pool : MemoryPool, default None
26372619
For memory allocations, if required. If not specified, uses the
26382620
default pool.
26392621
use_threads : bool, default True
26402622
If enabled, then maximum parallelism will be used determined by
26412623
the number of available CPU cores.
2642-
use_async : bool, default True
2643-
This flag is deprecated and is being kept for this release for
2644-
backwards compatibility. It will be removed in the next
2645-
release.
26462624
memory_pool : MemoryPool, default None
26472625
For memory allocations, if required. If not specified, uses the
26482626
default pool.
@@ -2654,11 +2632,6 @@ cdef class Scanner(_Weakrefable):
26542632

26552633
schema = schema or fragment.physical_schema
26562634

2657-
if use_async is not None:
2658-
warnings.warn('The use_async flag is deprecated and has no '
2659-
'effect. It will be removed in the next release.',
2660-
FutureWarning)
2661-
26622635
builder = make_shared[CScannerBuilder](pyarrow_unwrap_schema(schema),
26632636
fragment.unwrap(), options)
26642637
_populate_builder(builder, columns=columns, filter=filter,
@@ -2675,8 +2648,7 @@ cdef class Scanner(_Weakrefable):
26752648
def from_batches(source, *, Schema schema=None, object columns=None,
26762649
Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
26772650
FragmentScanOptions fragment_scan_options=None,
2678-
bint use_threads=True, object use_async=None,
2679-
MemoryPool memory_pool=None):
2651+
bint use_threads=True, MemoryPool memory_pool=None):
26802652
"""
26812653
Create a Scanner from an iterator of batches.
26822654
@@ -2702,10 +2674,6 @@ cdef class Scanner(_Weakrefable):
27022674
use_threads : bool, default True
27032675
If enabled, then maximum parallelism will be used determined by
27042676
the number of available CPU cores.
2705-
use_async : bool, default True
2706-
This flag is deprecated and is being kept for this release for
2707-
backwards compatibility. It will be removed in the next
2708-
release.
27092677
memory_pool : MemoryPool, default None
27102678
For memory allocations, if required. If not specified, uses the
27112679
default pool.
@@ -2730,12 +2698,6 @@ cdef class Scanner(_Weakrefable):
27302698
'batches instead of the given type: ' +
27312699
type(source).__name__)
27322700
builder = CScannerBuilder.FromRecordBatchReader(reader.reader)
2733-
2734-
if use_async is not None:
2735-
warnings.warn('The use_async flag is deprecated and has no '
2736-
'effect. It will be removed in the next release.',
2737-
FutureWarning)
2738-
27392701
_populate_builder(builder, columns=columns, filter=filter,
27402702
batch_size=batch_size, batch_readahead=_DEFAULT_BATCH_READAHEAD,
27412703
fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, use_threads=use_threads,

python/pyarrow/tests/test_dataset.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -512,32 +512,6 @@ def test_scanner_memory_pool(dataset):
512512
pa.set_memory_pool(old_pool)
513513

514514

515-
@pytest.mark.parquet
516-
def test_scanner_async_deprecated(dataset):
517-
with pytest.warns(FutureWarning):
518-
dataset.scanner(use_async=False)
519-
with pytest.warns(FutureWarning):
520-
dataset.scanner(use_async=True)
521-
with pytest.warns(FutureWarning):
522-
dataset.to_table(use_async=False)
523-
with pytest.warns(FutureWarning):
524-
dataset.to_table(use_async=True)
525-
with pytest.warns(FutureWarning):
526-
dataset.head(1, use_async=False)
527-
with pytest.warns(FutureWarning):
528-
dataset.head(1, use_async=True)
529-
with pytest.warns(FutureWarning):
530-
ds.Scanner.from_dataset(dataset, use_async=False)
531-
with pytest.warns(FutureWarning):
532-
ds.Scanner.from_dataset(dataset, use_async=True)
533-
with pytest.warns(FutureWarning):
534-
ds.Scanner.from_fragment(
535-
next(dataset.get_fragments()), use_async=False)
536-
with pytest.warns(FutureWarning):
537-
ds.Scanner.from_fragment(
538-
next(dataset.get_fragments()), use_async=True)
539-
540-
541515
@pytest.mark.parquet
542516
def test_head(dataset, dataset_reader):
543517
result = dataset_reader.head(dataset, 0)

0 commit comments

Comments
 (0)