@@ -63,7 +63,7 @@ def concat(dataframes: Sequence[DataFrame]) -> DataFrame:
63
63
"""
64
64
...
65
65
66
- def column_from_sequence (sequence : Sequence [Any ], * , dtype : Any , name : str = '' ) -> Column [Any ]:
66
+ def column_from_sequence (sequence : Sequence [Any ], * , dtype : Any , name : str = '' , api_version : str | None = None ) -> Column [Any ]:
67
67
"""
68
68
Construct Column from sequence of elements.
69
69
@@ -77,14 +77,21 @@ def column_from_sequence(sequence: Sequence[Any], *, dtype: Any, name: str = '')
77
77
Name of column.
78
78
dtype : DType
79
79
Dtype of result. Must be specified.
80
+ api_version: str | None
81
+ A string representing the version of the dataframe API specification
82
+ in ``'YYYY.MM'`` form, for example, ``'2023.04'``.
83
+ If it is ``None``, it should return an object corresponding to
84
+ latest version of the dataframe API specification. If the given
85
+ version is invalid or not implemented for the given module, an
86
+ error should be raised. Default: ``None``.
80
87
81
88
Returns
82
89
-------
83
90
Column
84
91
"""
85
92
...
86
93
87
- def dataframe_from_dict (data : Mapping [str , Column [Any ]]) -> DataFrame :
94
+ def dataframe_from_dict (data : Mapping [str , Column [Any ]], * , api_version : str | None = None ) -> DataFrame :
88
95
"""
89
96
Construct DataFrame from map of column names to Columns.
90
97
@@ -94,6 +101,13 @@ def dataframe_from_dict(data: Mapping[str, Column[Any]]) -> DataFrame:
94
101
Column must be of the corresponding type of the DataFrame.
95
102
For example, it is only supported to build a ``LibraryXDataFrame`` using
96
103
``LibraryXColumn`` instances.
104
+ api_version: str | None
105
+ A string representing the version of the dataframe API specification
106
+ in ``'YYYY.MM'`` form, for example, ``'2023.04'``.
107
+ If it is ``None``, it should return an object corresponding to
108
+ latest version of the dataframe API specification. If the given
109
+ version is invalid or not implemented for the given module, an
110
+ error should be raised. Default: ``None``.
97
111
98
112
Returns
99
113
-------
@@ -109,7 +123,7 @@ def dataframe_from_dict(data: Mapping[str, Column[Any]]) -> DataFrame:
109
123
...
110
124
111
125
112
- def column_from_1d_array (array : Any , * , dtype : Any , name : str = '' ) -> Column [Any ]:
126
+ def column_from_1d_array (array : Any , * , dtype : Any , name : str = '' , api_version : str | None = None ) -> Column [Any ]:
113
127
"""
114
128
Construct Column from 1D array.
115
129
@@ -127,14 +141,21 @@ def column_from_1d_array(array: Any, *, dtype: Any, name: str = '') -> Column[An
127
141
Name to give columns.
128
142
dtype : DType
129
143
Dtype of column.
144
+ api_version: str | None
145
+ A string representing the version of the dataframe API specification
146
+ in ``'YYYY.MM'`` form, for example, ``'2023.04'``.
147
+ If it is ``None``, it should return an object corresponding to
148
+ latest version of the dataframe API specification. If the given
149
+ version is invalid or not implemented for the given module, an
150
+ error should be raised. Default: ``None``.
130
151
131
152
Returns
132
153
-------
133
154
Column
134
155
"""
135
156
...
136
157
137
- def dataframe_from_2d_array (array : Any , * , names : Sequence [str ], dtypes : Mapping [str , Any ]) -> DataFrame :
158
+ def dataframe_from_2d_array (array : Any , * , names : Sequence [str ], dtypes : Mapping [str , Any ], api_version : str | None = None ) -> DataFrame :
138
159
"""
139
160
Construct DataFrame from 2D array.
140
161
@@ -152,6 +173,13 @@ def dataframe_from_2d_array(array: Any, *, names: Sequence[str], dtypes: Mapping
152
173
Names to give columns. Must be the same length as ``array.shape[1]``.
153
174
dtypes : Mapping[str, DType]
154
175
Dtype of each column. Must be the same length as ``array.shape[1]``.
176
+ api_version: str | None
177
+ A string representing the version of the dataframe API specification
178
+ in ``'YYYY.MM'`` form, for example, ``'2023.04'``.
179
+ If it is ``None``, it should return an object corresponding to
180
+ latest version of the dataframe API specification. If the given
181
+ version is invalid or not implemented for the given module, an
182
+ error should be raised. Default: ``None``.
155
183
156
184
Returns
157
185
-------
0 commit comments