Skip to content

Fix 4 undefined-name (F821) errors caught by ruff #72

Description

@turbomam

Four locations reference names that are not in scope without the relevant optional extra being imported:

src/linkml_store/api/stores/dremio/dremio_database.py (lines 260, 319, 348)
Return-type annotations use the bare string "pyarrow.Table" but pyarrow is never imported in the module. With the dremio/pyarrow extra installed the annotation is never evaluated, so it doesn't raise at runtime — but ruff correctly flags it. Fix: add from __future__ import annotations (defers all annotation evaluation) or wrap the annotation in TYPE_CHECKING:

from __future__ import annotations

src/linkml_store/plotting/cli.py line 133
plt.matplotlib is used but plt is only imported inside a conditional block further down in the same function (or inside the analytics extra guard). Fix: ensure import matplotlib.pyplot as plt is in scope before use, or restructure the guard.

These are caught by ruff check --select F821. Blocking them in CI (see issue #71) would prevent regressions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions