Skip to content

Conversation

Jolanrensen
Copy link
Contributor

@Jolanrensen Jolanrensen commented Aug 28, 2025

Relates to Kotlin/dataframe#1140

Adds the ability to have full JSON library descriptors inside the libraries.json instead of just fqn's to integration classes.

This will be used in DataFrame to load the dataframe-jupyter artifact when dataframe-core is present without it (which is common when using your project as dependency to the notebook).

… anything a normal descriptor file can, like introduce dependencies, run init blocks etc. This allows libraries to adapt how they behave in notebooks without having to depend on the jupyter api
}

@Suppress("unused")
fun descriptor(descriptor: String) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't gradle have a better API for representing JSON's? BTW, probably use parameter lang injection here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image not sure! There are many Json wrappers on the classpath, but most are internally shadowed

return LibrariesScanResult(
fqns("definitions"),
fqns("producers"),
definitions = fqns("definitions"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better remove everything related to FQNS_PATH: we don't scan annotations anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so removing getScanResultFromAnnotations() altogether?

discardedFQNs.add(typeName)
false
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Redundant newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ktlint adds it because of the {} before it ;P

}
}

private fun Iterable<JsonObject>.filterDescriptorsToLoad() =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some comment is welcomed here, would be nice to see a description of the trouble you experienced

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, I can probably make this a bit more efficient by only storing the hash instead of the entire string

@ileasile
Copy link
Collaborator

@Jolanrensen please file the MR in space, we have a safe merge there

@ileasile ileasile closed this Aug 29, 2025
@ileasile ileasile deleted the descriptors-in-libraries.json branch August 29, 2025 12:56
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