Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 08:23 AM
Just in case anyone comes here in the future, this is kind of how Databricks executes these entry points... How I know? I have banged my head against this wall for a couple of hours already.
from importlib import metadata
package_name = "some.package"
entry_point = "my-entry-point"
available_entry_point = metadata.distribution(package_name).entry_points
entry = [ep for ep in available_entry_points if ep.name = entry_point]
if entry:
enstry[0].load()()
else:
# Imagine that <package-name> is replaced with the package name provided
# and same for <entry-point>
import <package-name>
<package-name>.<entry-point>()If you cannot see your entry point usint the following, then you (we) are out of luck.
from importlib import metadata
from pprint import pprint
package_name = "my.package"
pprint(metadata.distribution(package_name).entry_points)My current working theory is that the user installing the package is not the same user running the execution. Or for some weird reason the metadata is not available at the job runtime...