Skip to content

fix: latest_available_function does not reliably support plugin datasets #95

@turban

Description

@turban

Problem

sync.availability.latest_available_function accepts a dotted-path string, implying plugin support. However, the resolution in sync_engine._get_dynamic_function uses plain importlib.import_module without ensuring plugins_dir is on sys.path first.

Plugin availability functions only resolve if the dataset registry happened to run earlier in the same process (which adds plugins_dir to sys.path as a side effect). This is an accidental dependency on call ordering, not a guarantee.

The other three dotted-path extension points — ingestion.function, transforms:, and execution_function — all explicitly handle plugins_dir before resolving. This one does not.

Proposed resolution

Remove the implicit plugin support and restrict latest_available_function to built-in functions in climate_api/providers/availability.py. Availability logic is tightly coupled to provider behaviour (lag windows, release schedules) and belongs in core code, not plugins.

If a new provider cadence is needed, the right fix is a new built-in function or a new parameter on an existing one — not a plugin hook.

Acceptance criteria

  • Document that latest_available_function only supports built-in dotted paths
  • Optionally: validate at registry load time that the function resolves to a known built-in module, and raise a clear error if a plugin path is supplied

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions