DataFrameSchema

interface DataFrameSchema

Represents the schema of a dataframe, i.e., an ordered map of column names to their types.

Column types are represented by ColumnSchema:

  • For value columns, it contains the type of the column.

  • For column groups, it contains the DataFrameSchema of the nested columns.

  • For frame columns, it contains the DataFrameSchema of the contained dataframes.

Use org.jetbrains.kotlinx.dataframe.DataFrame.schema to read the schema of a DataFrame from its columns, and org.jetbrains.kotlinx.dataframe.DataFrame.compileTimeSchema to get the one that follows from its type.

Use compare to compare this schema with another schema using different comparison modes. The comparison ignores column order and can report how the schemas are related.

Use equals to check whether two schemas are exactly equal, including column order.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val columns: Map<String, ColumnSchema>

A map that defines the schema of the columns within a DataFrameSchema.

Functions

Link copied to clipboard
abstract fun compare(other: DataFrameSchema, comparisonMode: ComparisonMode = ComparisonMode.LENIENT): CompareResult

Compares this schema with other schema.

Link copied to clipboard
Link copied to clipboard
internal fun DataFrameSchema.generateCodeImpl(markerName: String, extensionProperties: Boolean, visibility: MarkerVisibility, useFqNames: Boolean, nameNormalizer: NameNormalizer, asDataClass: Boolean, knownMarkers: Iterable<Marker> = emptyList(), nestedMarkerNameProvider: MarkerNameProvider = MarkerNameProvider.fromColumnName): CodeString

Generates a CodeString containing generated @DataSchema declarations (markers).

Link copied to clipboard
@JvmName(name = "generateDataClassesForSchema")
fun DataFrameSchema.generateDataClasses(markerName: String, extensionProperties: Boolean = false, visibility: MarkerVisibility = MarkerVisibility.IMPLICIT_PUBLIC, useFqNames: Boolean = false, nameNormalizer: NameNormalizer = NameNormalizer.default, nestedMarkerNameProvider: MarkerNameProvider = MarkerNameProvider.fromColumnName): CodeString

Generates a CodeString containing generated @DataSchema data classes for the given DataFrameSchema (including all nested frame columns and column groups).

Link copied to clipboard
@JvmName(name = "generateInterfacesForSchema")
fun DataFrameSchema.generateInterfaces(markerName: String, extensionProperties: Boolean = false, visibility: MarkerVisibility = MarkerVisibility.IMPLICIT_PUBLIC, useFqNames: Boolean = false, nameNormalizer: NameNormalizer = NameNormalizer.default, nestedMarkerNameProvider: MarkerNameProvider = MarkerNameProvider.fromColumnName): CodeString

Generates a CodeString containing generated @DataSchema interfaces for the given DataFrameSchema (including all nested frame columns and column groups).

Link copied to clipboard
Link copied to clipboard