Skip to content

[Compiler plugin] Support dataFrameOf(Pair<String, List<T>) #908

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
Oct 7, 2024

Conversation

koperagen
Copy link
Collaborator

@koperagen koperagen commented Oct 3, 2024

Change in buildLetCall is needed because this function has a unique (...) -> DataFrame shape, while most other have some kind of Receiver.(...) -> DataFrame
df.convert { }.with { } -> df.convert { }.let { it.with { } as ... }

for (...) -> DataFrame it will be
dataFrameOf(pairs) -> run { dataFrameOf(pairs) as ... }

@koperagen koperagen added the Compiler plugin Anything related to the DataFrame Compiler Plugin label Oct 3, 2024
@koperagen koperagen added this to the 0.15.0 milestone Oct 3, 2024
@koperagen koperagen requested a review from Jolanrensen October 3, 2024 16:18
@koperagen koperagen self-assigned this Oct 3, 2024
@koperagen
Copy link
Collaborator Author

image

internal fun FirFunctionCall.loadInterpreter(session: FirSession): Interpreter<*>? {
if (
calleeReference.toResolvedNamedFunctionSymbol()?.callableId == Names.TO &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

so.. does this mean it fails for dataFrameOf(Pair("name", listOf(1, 2, 3)))?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's probably fine, most people will use to anyway, but it might be something we should mention in a doc somewhere, for that one person who's going to be very confused as to why their Pair is not recognized by the plugin if the function only accepts pairs as the type argument.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. Let's support Pair after i put in place more generic way for handling stdlib functions other than "if". And indeed with such things it's much easier to run into something plugin won't understand. One of the things that can be addressed with custom Checker that will highlight it as warning

Copy link
Contributor

github-actions bot commented Oct 4, 2024

Generated sources will be updated after merging this PR.
Please inspect the changes in here.

@koperagen koperagen merged commit bc4a236 into master Oct 7, 2024
7 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.

2 participants