Skip to content

Generated provider schema cannot be instantiated with --with-schema #505

Description

@fallintoplace

Describe the overall issue and situation

Running the provider plugin generator with --with-schema creates a schema class that remains abstract. The generated class implements supports_strict_mode, while BaseSchema requires the abstract requires_raw_output property.

The generator reports that schema support was added, but calling from_examples raises a TypeError when it tries to instantiate the class.

Steps to reproduce the issue

  1. Generate a provider plugin:

    python scripts/create_provider_plugin.py MyProvider --with-schema --no-install
  2. Import MyProviderSchema from the generated package.

  3. Call MyProviderSchema.from_examples([]).

The call fails with:

TypeError: Can't instantiate abstract class MyProviderSchema without an implementation for abstract method 'requires_raw_output'

Expected behavior

A schema generated by the advertised --with-schema workflow should implement the current BaseSchema contract and be instantiable through from_examples.

Environment

Reproduced on current main at b5fe0ba with Python 3.12.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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