Skip to content

Commit b141780

Browse files
init migration guide
1 parent 0f9062b commit b141780

File tree

2 files changed

+233
-0
lines changed

2 files changed

+233
-0
lines changed

docs/StardustDocs/d.tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,5 @@
227227
<toc-element topic="Support.md"/>
228228
<toc-element topic="FAQ.md"/>
229229
<toc-element topic="Migration-From-Plugins.md"/>
230+
<toc-element topic="MigrationTo_1_0.md"/>
230231
</instance-profile>
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
# Migration to 1.0
2+
3+
## Модули
4+
5+
## Компайлер плагин
6+
7+
убрали градл/ксп плагины
8+
9+
## Deprecations and removals
10+
11+
На пути к 1.0, многие функции были изменены, deprecated или удалены.
12+
В данном разделе вы узнаете обо всех измнениях в API для миграции на 1.0
13+
14+
### Migration to Deephaven CSV
15+
16+
All CSV (as well as TSV) IO was migrated
17+
to a new, fast and efficient
18+
[Deephaven CSV](https://github.com/deephaven/deephaven-csv) implementation.
19+
It signigicantly improves CSV IO performance, and brings a lot of
20+
new parametrization options.
21+
22+
All related methods
23+
are now in the separate [`dataframe-csv`](Modules.md#dataframe-csv) module (
24+
which is included by default in the general [`dataframe`](Modules.md#dataframe-general) artifact
25+
and in `%use dataframe` in [Kotlin Notebook](SetupKotlinNotebook.md).
26+
).
27+
28+
Functions were also renamed to the correct CamelCase spelling.
29+
30+
> All outdated CSV IO functions raise `WARNING` in 1.0 and will raise `ERROR` in 1.1.
31+
32+
| 0.15 | 1.0 |
33+
|------------------------------------|---------------------------------------|
34+
| `DataFrame.readCSV(..)` | `DataFrame.readCsv(..)` |
35+
| `DataFrame.readTSV(..)` | `DataFrame.readTsv(..)` |
36+
| `DataFrame.read(delimeter=.., ..)` | `DataFrame.readCsv(delimeter=.., ..)` |
37+
| `DataFrame.writeCSV(..)` | `DataFrame.writeCsv(..)` |
38+
39+
### Migration to Standard Library `Instant`
40+
41+
Since Kotlin 2.1.20,
42+
[`Instant` is now part of the standard library](https://kotlinlang.org/docs/whatsnew2120.html#new-time-tracking-functionality)
43+
(as `kotlin.time.Instant`).
44+
You can still use the old (deprecated) `kotlinx.datetime.Instant` type, but its support will be removed in 1.1.
45+
46+
47+
### Removed functions and classes
48+
49+
The next functions and classes raise `ERROR` in 1.0 and will be removed in 1.1.
50+
51+
| 0.15 | 1.0 | Reason |
52+
|--------------------------------------------------------------|------------------------------------------------------------------------------|---------------------------------------|
53+
| `DataColumn.createFrameColumn(name, df, startIndices)` | `df.chunked(name, startIndices)` | Replaced with an other function |
54+
| `DataColumn.createWithTypeInference(name, values, nullable)` | `DataColumn.createByInference(name, values, TypeSuggestion.Infer, nullable)` | Replaced with an other function |
55+
| `DataColumn.create(name, values, infer)` | `DataColumn.createByType(name, values, infer)` | Replaced with an other function |
56+
| `col.isComparable()` | `col.valuesAreComparable()` | Renamed to better reflect its purpose |
57+
| `df.minus(columns)` | `df.remove(columns)` | Replaced with an other function |
58+
| `df.move(columns).toLeft()`/`df.moveToLeft(columns)` | `df.move(columns).toStart()`/`df.moveToStart(columns)` | Renamed to better reflect its purpose |
59+
| `df.move(columns).toRight()`/`df.moveToRight(columns)` | `df.move(columns).toEnd()`/`df.moveToEnd(columns)` | Renamed to better reflect its purpose |
60+
| `row.rowMin()`/`row.rowMinOrNull()` | `row.rowMinOf()`/`row.rowMinOfOrNull()` | Renamed to better reflect its purpose |
61+
| `row.rowMax()`/`row.rowMaxOrNull()` | `row.rowMaxOf()`/`AnyRow.rowMaxOfOrNull()` | Renamed to better reflect its purpose |
62+
| `row.rowPercentile()`/`row.rowPercentileOrNull()` | `row.rowPercentileOf()`/`row.rowPercentileOfOrNull()` | Renamed to better reflect its purpose |
63+
| `row.rowMedian()`/`row.rowMedianOrNull()` | `row.rowMedianOf()`/`row.rowMedianOfOrNull()` | Renamed to better reflect its purpose |
64+
| `df.convert(columns).to(converter)` | `df.convert(columns).asColumn(converter)` | Renamed to better reflect its purpose |
65+
| `df.toHTML(..)`/`df.toStandaloneHTML()` | `df.toHtml(..)`/`df.toStandaloneHtml()` | Renamed to the correct CamelCase |
66+
| `df.writeHTML()` | `df.writeHtml()` | Renamed to the correct CamelCase |
67+
| `asURL(fileOrUrl)`/`isURL(path)` | `asUrl(fileOrUrl)`/`isUrl(path)` | Renamed to the correct CamelCase |
68+
| `df.convert(columns).toURL()`/`df.convertToURL(columns)` | `df.convert(columns).toUrl()`/`df.convertToUrl(columns)` | Renamed to the correct CamelCase |
69+
| `df.filterBy(column)` | `df.filter { column }` | Replaced with an other function |
70+
| `FormattingDSL` | `FormattingDsl` | Renamed to the correct CamelCase |
71+
| `RGBColor` | `RgbColor` | Renamed to the correct CamelCase |
72+
| `` | `` | Renamed to better reflect its purpose |
73+
| `` | `` | Renamed to better reflect its purpose |
74+
| `` | `` | Renamed to better reflect its purpose |
75+
| `` | `` | Renamed to better reflect its purpose |
76+
77+
#### Deprecation of `.cols()` in Columns Selection DSL
78+
79+
`.cols()` overloads without arguments, that selects all columns of the dataframe /
80+
all subcolumns inside the column group in [Columns Selection DSL](ColumnSelectors.md),
81+
are deprecated in favor of `.all()` and `.allCols()` correspondingly, allowing to
82+
support this selection in the Compiler Plugin.
83+
84+
| 0.15 | 1.0 |
85+
|--------------------------------------------------------------|------------------------------------------------------------------------------|
86+
| `df.select { cols() }` | `df.select { all() }` |
87+
| `df.select { group.cols() }` | `df.select { group.allCols() }` |
88+
89+
// region WARNING in 0.15, ERROR in 1.0
90+
91+
92+
93+
internal const val CONVERT_TO_INSTANT =
94+
"kotlinx.datetime.Instant is deprecated in favor of kotlin.time.Instant. Either migrate to kotlin.time.Instant and use convertToStdlibInstant() or use convertToDeprecatedInstant(). $MESSAGE_1_0 and migrated to kotlin.time.Instant in 1.1."
95+
internal const val CONVERT_TO_INSTANT_REPLACE = "this.convertToDeprecatedInstant()"
96+
97+
internal const val TO_INSTANT =
98+
"kotlinx.datetime.Instant is deprecated in favor of kotlin.time.Instant. Either migrate to kotlin.time.Instant and use toStdlibInstant() or use toDeprecatedInstant(). $MESSAGE_1_0 and migrated to kotlin.time.Instant in 1.1."
99+
internal const val TO_INSTANT_REPLACE = "this.toDeprecatedInstant()"
100+
101+
internal const val COL_TYPE_INSTANT =
102+
"kotlinx.datetime.Instant is deprecated in favor of kotlin.time.Instant. Either migrate to kotlin.time.Instant and use ColType.StdlibInstant or use ColType.DeprecatedInstant. $MESSAGE_1_0 and migrated to kotlin.time.Instant in 1.1."
103+
internal const val COL_TYPE_INSTANT_REPLACE = "ColType.DeprecatedInstant"
104+
105+
internal const val INSERT_AFTER_COL_PATH =
106+
"This `after()` overload will be removed in favor of `after { }` with Column Selection DSL. $MESSAGE_1_0"
107+
internal const val INSERT_AFTER_COL_PATH_REPLACE = "this.after { columnPath }"
108+
109+
110+
internal const val COMPARE_RESULT_EQUALS =
111+
"'Equals' is deprecated in favor of 'Matches' to clarify column order is irrelevant. $MESSAGE_1_0"
112+
113+
// endregion
114+
115+
// region WARNING in 1.0, ERROR in 1.1
116+
117+
private const val MESSAGE_1_1 = "Will be ERROR in 1.1."
118+
119+
internal const val APACHE_CSV =
120+
"The Apache-based CSV/TSV reader is deprecated in favor of the new Deephaven CSV reader in dataframe-csv. $MESSAGE_1_1"
121+
internal const val READ_CSV =
122+
"Apache-based readCSV() is deprecated in favor of Deephaven-based readCsv() in dataframe-csv. $MESSAGE_1_1"
123+
internal const val READ_CSV_IMPORT = "org.jetbrains.kotlinx.dataframe.io.readCsv"
124+
internal const val READ_CSV_FILE_OR_URL_REPLACE =
125+
"this.readCsv(fileOrUrl = fileOrUrl, delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
126+
internal const val READ_CSV_FILE_REPLACE =
127+
"this.readCsv(file = file, delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
128+
internal const val READ_CSV_URL_REPLACE =
129+
"this.readCsv(url = url, delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
130+
internal const val READ_CSV_STREAM_REPLACE =
131+
"this.readCsv(inputStream = stream, delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
132+
133+
internal const val READ_DELIM =
134+
"Apache-based readDelim() is deprecated in favor of Deephaven-based readDelim() in dataframe-csv. $MESSAGE_1_1"
135+
internal const val READ_DELIM_STREAM_REPLACE =
136+
"this.readDelim(inputStream = inStream, delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
137+
internal const val READ_DELIM_READER_REPLACE =
138+
"this.readDelimStr(text = reader.readText(), delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
139+
140+
internal const val READ_TSV =
141+
"Apache-based readTSV() is deprecated in favor of Deephaven-based readTsv() in dataframe-csv. $MESSAGE_1_1"
142+
internal const val READ_TSV_IMPORT = "org.jetbrains.kotlinx.dataframe.io.readTsv"
143+
internal const val READ_TSV_FILE_OR_URL_REPLACE =
144+
"this.readTsv(fileOrUrl = fileOrUrl, delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
145+
internal const val READ_TSV_FILE_REPLACE =
146+
"this.readTsv(file = file, delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
147+
internal const val READ_TSV_URL_REPLACE =
148+
"this.readTsv(url = url, delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
149+
internal const val READ_TSV_STREAM_REPLACE =
150+
"this.readTsv(inputStream = stream, delimiter = delimiter, header = header, colTypes = colTypes, skipLines = skipLines, readLines = readLines, allowMissingColumns = duplicate, parserOptions = parserOptions)"
151+
152+
internal const val WRITE_CSV =
153+
"The writeCSV() functions are deprecated in favor of writeCsv() in dataframe-csv. $MESSAGE_1_1"
154+
internal const val WRITE_CSV_IMPORT = "org.jetbrains.kotlinx.dataframe.io.writeCsv"
155+
internal const val WRITE_CSV_FILE_REPLACE = "this.writeCsv(file = file)"
156+
internal const val WRITE_CSV_PATH_REPLACE = "this.writeCsv(path = path)"
157+
internal const val WRITE_CSV_WRITER_REPLACE = "this.writeCsv(writer = writer)"
158+
159+
internal const val TO_CSV = "toCsv() is deprecated in favor of toCsvStr() in dataframe-csv. $MESSAGE_1_1"
160+
internal const val TO_CSV_IMPORT = "org.jetbrains.kotlinx.dataframe.io.toCsvStr"
161+
internal const val TO_CSV_REPLACE = "this.toCsvStr()"
162+
163+
internal const val SPLIT_STR =
164+
"Please explicitly specify how the String should be split. Shortcut: $MESSAGE_1_1"
165+
166+
internal const val DATAFRAME_OF_WITH_VALUES =
167+
"Deprecated in favor of dataFrameOf(names).withValues(values). $MESSAGE_1_1"
168+
169+
internal const val COLS_AT_ANY_DEPTH = "Deprecated shortcut for better compiler plugin support. $MESSAGE_1_1"
170+
internal const val COLS_AT_ANY_DEPTH_REPLACE = "this.colsAtAnyDepth().filter(predicate)"
171+
172+
internal const val COLS_IN_GROUPS = "Deprecated shortcut for better compiler plugin support. $MESSAGE_1_1"
173+
internal const val COLS_IN_GROUPS_REPLACE = "this.colsInGroups().filter(predicate)"
174+
175+
internal const val SINGLE = "Deprecated shortcut for better compiler plugin support. $MESSAGE_1_1"
176+
internal const val SINGLE_COL_REPLACE = "this.allCols().filter(condition).single()"
177+
internal const val SINGLE_PLAIN_REPLACE = "this.cols().filter(condition).single()"
178+
internal const val SINGLE_SET_REPLACE = "this.filter(condition).single()"
179+
180+
internal const val GENERATE_CODE =
181+
"This function has been deprecated in favor of the more explicit `generateInterfaces()`. The `fields` parameter has also been removed. Use `CodeGenerator` explicitly, if you need it. $MESSAGE_1_1"
182+
183+
internal const val GENERATE_CODE_REPLACE1 = "this.generateInterfaces(extensionProperties = extensionProperties)"
184+
internal const val GENERATE_CODE_REPLACE2 =
185+
"this.generateInterfaces(markerName = markerName, extensionProperties = extensionProperties, visibility = visibility)"
186+
187+
internal const val GENERATE_INTERFACES = "This function is just here for binary compatibility. $MESSAGE_1_1"
188+
189+
internal const val UNIFIED_SIMILAR_CS_API = "Deprecated duplicated functionality. $MESSAGE_1_1"
190+
191+
internal const val CONVERT_TO_DEPRECATED_INSTANT =
192+
"kotlinx.datetime.Instant is deprecated in favor of kotlin.time.Instant. Migrate to kotlin.time.Instant and use convertToStdlibInstant() at your own pace. $MESSAGE_1_1"
193+
internal const val CONVERT_TO_DEPRECATED_INSTANT_REPLACE = "this.convertToStdlibInstant()"
194+
195+
internal const val TO_DEPRECATED_INSTANT =
196+
"kotlinx.datetime.Instant is deprecated in favor of kotlin.time.Instant. Migrate to kotlin.time.Instant and use toStdlibInstant() at your own pace. $MESSAGE_1_1"
197+
internal const val TO_DEPRECATED_INSTANT_REPLACE = "this.toStdlibInstant()"
198+
199+
internal const val COL_TYPE_DEPRECATED_INSTANT =
200+
"kotlinx.datetime.Instant is deprecated in favor of kotlin.time.Instant. Migrate to kotlin.time.Instant and use Coltype.StdlibInstant at your own pace. $MESSAGE_1_1"
201+
internal const val COL_TYPE_DEPRECATED_INSTANT_REPLACE = "ColType.StdlibInstant"
202+
203+
internal const val MESSAGE_SHORTCUT = "This shortcut is deprecated. $MESSAGE_1_1"
204+
205+
internal const val LENGTH_REPLACE = "this.map { it?.length ?: 0 }"
206+
internal const val LOWERCASE_REPLACE = "this.map { it?.lowercase() }"
207+
internal const val UPPERCASE_REPLACE = "this.map { it?.uppercase() }"
208+
209+
internal const val ADD_VARARG_COLUMNS = "Deprecated in favor of `addAll(vararg)` to improve completion. $MESSAGE_1_1"
210+
internal const val ADD_VARARG_COLUMNS_REPLACE = "this.addAll(*columns)"
211+
212+
internal const val ADD_VARARG_FRAMES = "Deprecated in favor of `addAll(vararg)` to improve completion. $MESSAGE_1_1"
213+
internal const val ADD_VARARG_FRAMES_REPLACE = "this.addAll(*dataFrames)"
214+
215+
internal const val IS_EMPTY_REPLACE = "values().all { it == null }"
216+
internal const val IS_NOT_EMPTY_REPLACE = "values().any { it != null }"
217+
internal const val GET_ROW_REPLACE = "df().getRow(index)"
218+
internal const val GET_ROWS_ITERABLE_REPLACE = "df().getRows(indices)"
219+
internal const val GET_ROWS_RANGE_REPLACE = "df().getRows(indices)"
220+
internal const val GET_ROW_OR_NULL_REPLACE = "df().getRowOrNull(index)"
221+
internal const val COPY_REPLACE = "columns().toDataFrame().cast()"
222+
223+
internal const val LISTS_TO_DATAFRAME_MIGRATION =
224+
"Function moved from io to api package, and a new `header` parameter is introduced. $MESSAGE_1_1"
225+
226+
internal const val KEY_VALUE_PROPERTY = "Deprecated in favor of NameValueProperty. $MESSAGE_1_1"
227+
internal const val KEY_VALUE_PROPERTY_KEY =
228+
"This column will be renamed to 'name' when KeyValueProperty will be replaced with NameValueProperty. $MESSAGE_1_1"
229+
230+
// endregion
231+
232+
## Changes in working with JDBC

0 commit comments

Comments
 (0)