Skip to content

Python producer codegen emits duplicate method parameters for repeated envelope placeholders #471

Closed

Description

@clemensv

Minimal reproducer from a new ERDDAP xRegistry manifest: a message with CloudEvents source template {base_url}/tabledap/{dataset_id} and subject template {erddap_id}/{dataset_id} generated a Python Kafka producer method with duplicate _dataset_id parameters, causing a SyntaxError on import/compile:

def send_org_erddap_dataset_metadata(self, _base_url: str, _dataset_id: str, _erddap_id: str, _dataset_id: str, data: DatasetMetadata, ...):
    ...

This happened because the same placeholder name appeared in multiple envelope attributes. A generator should de-duplicate method parameters across source/subject/key placeholders while still using the value in all template expansions, or fail generation with a clear diagnostic.

Temporary workaround in the ERDDAP feeder branch: changed the CloudEvents source template to {base_url} so the placeholder does not collide with the subject/key placeholders. That avoids the SyntaxError but loses the more specific tabledap source URL.

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