Skip to content

Example projects migration with compiler plugin#1734

Merged
Jolanrensen merged 9 commits intomasterfrom
youtube-example-separate-project
Mar 19, 2026
Merged

Example projects migration with compiler plugin#1734
Jolanrensen merged 9 commits intomasterfrom
youtube-example-separate-project

Conversation

@Jolanrensen
Copy link
Copy Markdown
Collaborator

@Jolanrensen Jolanrensen commented Mar 10, 2026

moving youtube and movies example projects to /examples/projects(/dev) with compiler plugin enabled

Helps #1614

@Jolanrensen Jolanrensen force-pushed the youtube-example-separate-project branch from 8c45513 to 69e4344 Compare March 10, 2026 13:02
@Jolanrensen Jolanrensen force-pushed the youtube-example-separate-project branch from 69e4344 to 106884e Compare March 13, 2026 14:39
@zaleslaw zaleslaw self-requested a review March 17, 2026 10:03
@Jolanrensen Jolanrensen marked this pull request as ready for review March 17, 2026 12:40
@Jolanrensen Jolanrensen added the examples Something related to the examples label Mar 17, 2026
// TODO replace with requireColumn {} when available
// parse cannot know what type the columns will be at runtime,
// so we need to cast the columns ourselves.
.cast<ParsedStats>(verify = true)
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 instead of ParsedStats use convert + with? temporarily

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

could work too. I don't think .convert { nameEndsWith("Count") } already works, right?

Copy link
Copy Markdown
Collaborator

@koperagen koperagen Mar 18, 2026

Choose a reason for hiding this comment

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

Looks like i made a silly mistake. What a shame lol
"NameEndsWith" -> NameEndsWith1()
image

image

Copy link
Copy Markdown
Collaborator

@koperagen koperagen Mar 18, 2026

Choose a reason for hiding this comment

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

change @Interpretable("NameEndsWith1") -> @Interpretable("NameEndsWith"), it'll work

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

alright! however then there will be a difference between the dev and the release version. Which is fine :) that's why we have two versions

Comment thread examples/projects/dev/movies/README.md
Comment thread examples/projects/dev/youtube/README.md
.split { genres }.by("|").inplace()
// TODO replace with `requireColumn {}` #1715 or replace+AddDsl #1749
.split { title }.by {
listOf<Any>(
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.

Thought of an another approach. Split List and perform convert later
listOf(
"""\s*(\d{4})\s*$""".toRegex().replace(title, ""),
"\d{4}".toRegex().findAll(title).lastOrNull()?.value ?: "",
)

and later

convert { year }.with { it.toIntOrNull() ?: -1 }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

only downside is that it creates String? types

Copy link
Copy Markdown
Collaborator Author

@Jolanrensen Jolanrensen Mar 18, 2026

Choose a reason for hiding this comment

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

even if the list is not nullable... is that supposed to happen?

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.

ahh, right
yes, if you split lists with different sizes then null values can appear, so we have to play safe

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.

another reason why we need specialized replace function :)

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.

image

@Jolanrensen
Copy link
Copy Markdown
Collaborator Author

Thanks! Fixed all feedback, fixed nameContains, and dependency substitution :)

@Jolanrensen Jolanrensen merged commit b26b621 into master Mar 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Something related to the examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants