Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Click-based CLI for overture-schema package."""

import builtins
import io
import json
import sys
from collections import Counter, defaultdict
Expand Down Expand Up @@ -322,8 +323,6 @@ def load_input(filename: Path) -> tuple[dict | list, str]:
pass

# Parse as single YAML/JSON document
import io

data = yaml.load(io.StringIO(content), Loader=CoreLoader)
return data, "<stdin>"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Any

from rich import box
from rich.panel import Panel
from rich.table import Table

Expand Down Expand Up @@ -670,8 +671,6 @@ def create_feature_display(
table.add_row(field_name_styled, value_styled, "", "")

# Wrap table in a Panel with rounded borders
from rich import box

# Add title: "Validation Failed" for single features, or item info for collections
if item_index is not None:
if item_type:
Expand Down
3 changes: 1 addition & 2 deletions packages/overture-schema-cli/tests/test_cli_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for CLI helper functions (load_input, perform_validation)."""

import io
import json
from pathlib import Path

Expand Down Expand Up @@ -175,8 +176,6 @@ def test_load_input_jsonl_from_stdin(
JSONL format is commonly used for streaming GeoJSON features where each line
is a complete JSON object/feature.
"""
import io

feature1 = build_feature(id="test1")
feature2 = build_feature(id="test2")
jsonl_input = f"{json.dumps(feature1)}\n{json.dumps(feature2)}\n"
Expand Down
3 changes: 1 addition & 2 deletions packages/overture-schema-cli/tests/test_data_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
select_context_fields,
)
from rich.console import Console
from rich.panel import Panel


class TestExtractFeatureData:
Expand Down Expand Up @@ -291,8 +292,6 @@ def test_creates_panel_with_table(self) -> None:
result = create_feature_display(fields, errors)

# Verify result is a Panel
from rich.panel import Panel

assert isinstance(result, Panel)

def test_includes_error_annotation(self) -> None:
Expand Down
3 changes: 1 addition & 2 deletions packages/overture-schema-cli/tests/test_resolve_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
from overture.schema.cli.commands import resolve_types
from overture.schema.core.discovery import discover_models


class TestResolveTypes:
Expand Down Expand Up @@ -124,8 +125,6 @@ def test_resolve_types_returns_expected_themes(
expected_themes: set[str],
) -> None:
"""Test that resolve_types returns models from expected themes."""
from overture.schema.core.discovery import discover_models

models = discover_models(namespace=namespace)
actual_themes = {key.theme for key in models.keys()}

Expand Down
3 changes: 1 addition & 2 deletions packages/overture-schema-cli/tests/test_type_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
get_or_create_structural_tuple,
introspect_union,
)
from pydantic import BaseModel, Field
from pydantic import BaseModel, Discriminator, Field


class TestStructuralTuples:
Expand Down Expand Up @@ -277,7 +277,6 @@ class Place(BaseModel):

def test_callable_discriminator_extracts_field_name(self) -> None:
"""Callable discriminators (Feature.field_discriminator) are supported."""
from pydantic import Discriminator

class ModelA(BaseModel):
kind: Literal["a"]
Expand Down
Loading