[//]: # (title: cast) Changes the type argument of the [`DataFrame`](DataFrame.md) instance without changing its contents. ```kotlin cast(verify = false) ``` Related operations: [](adjustSchema.md) **Parameters:** * `verify: Boolean = false` — when `true`, the function throws an exception if the [`DataFrame`](DataFrame.md) instance doesn't match the given schema. Otherwise, it just changes the format type without actual data checks. Use this operation to change the formal type of a [`DataFrame`](DataFrame.md) instance to match the expected schema and enable generated [extension properties](extensionPropertiesApi.md) for it. ```kotlin @DataSchema interface Person { val age: Int val name: String } df.cast() ``` To convert [`DataFrame`](DataFrame.md) columns to match given schema, use [`convertTo`](convertTo.md) operation. **Reusing implicitly generated schema** ```kotlin castTo(df: DataFrame) ``` In notebooks, dataframe types are implicitly generated. ![Implicitly generated schema](implicitlyGeneratedSchema.png) This type can be referred to, but its name will change whenever you re-execute cells. Here how you can do it in a more robust way: ```kotlin val sample = DataFrame.readJson("sample.json") ``` ```kotlin for (file in files) { // df here is expected to have the same structure as sample val df = DataFrame.readJson(file).castTo(sample) val count = df.count { perf > 10.0 } println("$file: $count") } ```