Skip to content

Commit 07dbf57

Browse files
authored
Add cast (#338)
* add cast * note what may vary across implementations
1 parent cf6eab6 commit 07dbf57

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

spec/API_specification/dataframe_api/column_object.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,3 +1068,13 @@ def persist(self) -> Self:
10681068
at most once per dataframe, and as late as possible in the pipeline.
10691069
"""
10701070
...
1071+
1072+
def cast(self, dtype: DType) -> Self:
1073+
"""Cast specified columns to specified dtypes.
1074+
1075+
The following is not specified and may vary across implementations:
1076+
1077+
- Cross-kind casting (e.g. integer to string, or to float)
1078+
- Behaviour in the case of overflows
1079+
"""
1080+
...

spec/API_specification/dataframe_api/dataframe_object.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,3 +926,13 @@ def persist(self) -> Self:
926926
]
927927
"""
928928
...
929+
930+
def cast(self, dtypes: Mapping[str, DType]) -> Self:
931+
"""Convert specified columns to specified dtypes.
932+
933+
The following is not specified and may vary across implementations:
934+
935+
- Cross-kind casting (e.g. integer to string, or to float)
936+
- Behaviour in the case of overflows
937+
"""
938+
...

0 commit comments

Comments
 (0)