Skip to content

[Compiler plugin] Add warning to avoid confusion with missing extension properties #979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

koperagen
Copy link
Collaborator

@koperagen koperagen commented Nov 29, 2024

image

@koperagen koperagen added the Compiler plugin Anything related to the DataFrame Compiler Plugin label Nov 29, 2024
@koperagen koperagen added this to the 0.16.0 milestone Nov 29, 2024
@koperagen koperagen self-assigned this Nov 29, 2024
val targetType = targetProjection.typeRef.coneType as? ConeClassLikeType ?: return
val targetSymbol = targetType.toSymbol(session)
if (targetSymbol != null && !targetSymbol.hasAnnotation(Names.DATA_SCHEMA_CLASS_ID, session)) {
val text = "Annotate ${targetType.renderReadable()} with @DataSchema to use generated properties"
Copy link
Collaborator

Choose a reason for hiding this comment

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

cool!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Very useful thing!

@Jolanrensen
Copy link
Collaborator

So this adds a user-facing warning when they try to cast their DF to a non-DataSchema type?

@koperagen
Copy link
Collaborator Author

koperagen commented Dec 3, 2024

Updated OP with a screenshot. Thank you for reviews!

@koperagen koperagen merged commit cdbb23f into master Dec 12, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler plugin Anything related to the DataFrame Compiler Plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants