jorisvandenbossche commented on code in PR #36846:
URL: https://github.com/apache/arrow/pull/36846#discussion_r1348635657
##########
python/pyarrow/table.pxi:
##########
@@ -5024,31 +5024,35 @@ def table(data, names=None, schema=None, metadata=None,
nthreads=None):
"Expected pandas DataFrame, python dictionary or list of arrays")
-def concat_tables(tables, c_bool promote=False, MemoryPool memory_pool=None):
+def concat_tables(tables, MemoryPool memory_pool=None, str
promote_options="none", **kwargs):
"""
Concatenate pyarrow.Table objects.
- If promote==False, a zero-copy concatenation will be performed. The schemas
+ If promote_options=="none", a zero-copy concatenation will be performed.
The schemas
Review Comment:
```suggestion
If promote_options="none", a zero-copy concatenation will be performed.
The schemas
```
##########
python/pyarrow/types.pxi:
##########
@@ -3174,6 +3174,10 @@ def unify_schemas(schemas):
----------
schemas : list of Schema
Schemas to merge into a single one.
+ promote_options : str, default default
+ Accepts strings "default" and "permissive".
+ Default; null and only null can be unified with another type.
+ Permissive; promotes types to the greater common denominator.
Review Comment:
```suggestion
Default: null and only null can be unified with another type.
Permissive: types are promoted to the greater common denominator.
```
##########
python/pyarrow/table.pxi:
##########
@@ -5078,11 +5082,24 @@ def concat_tables(tables, c_bool promote=False,
MemoryPool memory_pool=None):
CConcatenateTablesOptions options = (
CConcatenateTablesOptions.Defaults())
+ if "promote" in kwargs:
+ warnings.warn(
+ "promote has been superseded by mode='default'.", FutureWarning)
Review Comment:
```suggestion
"promote has been superseded by mode='default'.", FutureWarning,
stacklevel=2)
```
##########
python/pyarrow/table.pxi:
##########
@@ -5024,31 +5024,35 @@ def table(data, names=None, schema=None, metadata=None,
nthreads=None):
"Expected pandas DataFrame, python dictionary or list of arrays")
-def concat_tables(tables, c_bool promote=False, MemoryPool memory_pool=None):
+def concat_tables(tables, MemoryPool memory_pool=None, str
promote_options="none", **kwargs):
"""
Concatenate pyarrow.Table objects.
- If promote==False, a zero-copy concatenation will be performed. The schemas
+ If promote_options=="none", a zero-copy concatenation will be performed.
The schemas
of all the Tables must be the same (except the metadata), otherwise an
exception will be raised. The result Table will share the metadata with the
first table.
- If promote==True, any null type arrays will be casted to the type of other
+ If promote_options=="default", any null type arrays will be casted to the
type of other
Review Comment:
```suggestion
If promote_options="default", any null type arrays will be casted to the
type of other
```
##########
python/pyarrow/table.pxi:
##########
@@ -5078,11 +5082,24 @@ def concat_tables(tables, c_bool promote=False,
MemoryPool memory_pool=None):
CConcatenateTablesOptions options = (
CConcatenateTablesOptions.Defaults())
+ if "promote" in kwargs:
+ warnings.warn(
+ "promote has been superseded by mode='default'.", FutureWarning)
+ if kwargs['promote'] is True:
+ promote_options = "permissive"
Review Comment:
```suggestion
promote_options = "default"
```
Isn't that needed to preserve the current default behaviour?
--
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]