Skip to content

Added troubleshooting guide for Data Schemas and Extension Properties#1870

Open
AndreiKingsley wants to merge 2 commits into
masterfrom
schemas_troubleshooting_docs
Open

Added troubleshooting guide for Data Schemas and Extension Properties#1870
AndreiKingsley wants to merge 2 commits into
masterfrom
schemas_troubleshooting_docs

Conversation

@AndreiKingsley
Copy link
Copy Markdown
Collaborator

Helps #1742.

This is a new page for the referencing from EP errors.

@AndreiKingsley AndreiKingsley changed the title Add troubleshooting guide for Data Schemas Added troubleshooting guide for Data Schemas and Extension Properties May 22, 2026
```

This means there is a runtime error while accessing a [`DataFrame` extension property](extensionPropertiesApi.md),
generated by the [Compiler Plugin](Compiler-Plugin.md) or in the [Kotlin Notebook](SetupKotlinNotebook.md).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*in Kotlin Notebook (the name of the product), or *in a (Kotlin) notebook (the concept)

This means there is a runtime error while accessing a [`DataFrame` extension property](extensionPropertiesApi.md),
generated by the [Compiler Plugin](Compiler-Plugin.md) or in the [Kotlin Notebook](SetupKotlinNotebook.md).

Such errors are caused by generating extension properties for data schemas that are not compatible with the
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe "mismatch" is a better fit here


Such errors are caused by generating extension properties for data schemas that are not compatible with the
[`DataFrame`](DataFrame.md), [`DataRow`](DataRow.md), etc.
In most cases, the schema contains columns of the wrong names or types.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

columns with an incorrect name or type

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example:


### Incompatible manually defined data schema

If you define initad data schema manually,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the initial

### Incompatible manually defined data schema

If you define initad data schema manually,
make sure your data schema is compatible with the [`DataFrame`](DataFrame.md).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the concept "the dataframe" is better here

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and you're describing just a solution here, not the reason it fails. I'd make a clear distinction for first the reason it fails and then second how to solve it

> Such cases are most probably bugs! Please report them on [GitHub Issues](https://github.com/Kotlin/dataframe/issues).
{style="warning"}

Possible workarounds:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here it's better :) first you describe the problem/cause and then the workaround


Possible workarounds:

* Specify the correct type using [`.replace {}`](replace.md) and `ValueColumn.changeType()`:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be important to mention the two different ways a column can have a "type". There's the internal KType, used by runtime functions, and there's the compile-time type, visible in the IDE, which is also sometimes used in runtime when you refer to a column in an inline reified function, but usually it's visual only

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh and this workaround only works if you're working with a value column, obviously ;P

#### Problems with type affinity in SQLite

Because of [SQLite type affinity](https://sqlite.org/datatype3.html),
the column typed defined by JDBC may differ from the actual values in the column.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you link to JDBC docs?


You can provide types for such columns manually:

```Kotlin
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

korro :)


* Specify the correct type using [`.replace {}`](replace.md) and `ValueColumn.changeType()`:

```kotlin
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

korro?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants