Skip to content

Commit 5543674

Browse files
committed
fixed list
1 parent de06586 commit 5543674

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

pandas/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
floating,
5454
integer,
5555
interval,
56-
list,
56+
list_dtype,
5757
map,
5858
period,
5959
sparse,
@@ -326,7 +326,7 @@
326326
"isna",
327327
"isnull",
328328
"json_normalize",
329-
"list",
329+
"list_dtype",
330330
"lreshape",
331331
"map",
332332
"melt",

pandas/core/dtypes/factory.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def boolean(
314314
return ArrowDtype(pa.bool_())
315315

316316

317-
def list(
317+
def list_dtype(
318318
value_type: Any = None,
319319
large: bool = False,
320320
backend: Literal["numpy", "pyarrow"] = "numpy",
@@ -339,13 +339,13 @@ def list(
339339
340340
Examples
341341
--------
342-
>>> list() # Default numpy backend
342+
>>> list_dtype() # Default numpy backend
343343
object
344-
>>> list(backend="pyarrow") # PyArrow backend with default int64
344+
>>> list_dtype(backend="pyarrow") # PyArrow backend with default int64
345345
list[int64][pyarrow]
346-
>>> list(value_type=pa.string(), backend="pyarrow") # PyArrow with string
346+
>>> list_dtype(value_type=pa.string(), backend="pyarrow") # PyArrow with string
347347
list[string][pyarrow]
348-
>>> list(
348+
>>> list_dtype(
349349
... value_type=pa.string(), large=True, backend="pyarrow"
350350
... ) # PyArrow large list
351351
large_list[string][pyarrow]

pandas/tests/api/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class TestPDApi(Base):
128128
"interval_range",
129129
"isna",
130130
"isnull",
131-
"list",
131+
"list_dtype",
132132
"lreshape",
133133
"map",
134134
"melt",

pandas/tests/dtypes/test_factory.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
floating,
1919
integer,
2020
interval,
21-
list,
21+
list_dtype,
2222
map,
2323
period,
2424
sparse,
@@ -165,21 +165,21 @@ def test_boolean_pyarrow():
165165

166166
# List
167167
def test_list_default():
168-
result = list()
168+
result = list_dtype()
169169
assert result == np.dtype("object")
170170
assert isinstance(result, np.dtype)
171171

172172

173173
def test_list_pyarrow():
174174
pa = pytest.importorskip("pyarrow")
175-
result = list(backend="pyarrow", value_type=pa.int64())
175+
result = list_dtype(backend="pyarrow", value_type=pa.int64())
176176
assert isinstance(result, ArrowDtype)
177177
assert str(result) == "list<item: int64>[pyarrow]"
178178

179179

180180
def test_list_large():
181181
pa = pytest.importorskip("pyarrow")
182-
result = list(backend="pyarrow", value_type=pa.string(), large=True)
182+
result = list_dtype(backend="pyarrow", value_type=pa.string(), large=True)
183183
assert isinstance(result, ArrowDtype)
184184
assert str(result) == "large_list<item: string>[pyarrow]"
185185

0 commit comments

Comments
 (0)