Skip to content

Sigma converter silently drops key columns when a relationship's from_columns/to_columns lengths differ #405

Description

@AmirF194

Summary

OSIToSigmaConverter._build_relationship pairs a relationship's from_columns and to_columns with a bare zip(). The OSI schema only requires each array to have at least one entry independently ($defs/Relationship in core-spec/ossie-schema.json); it does not require them to be the same length. So a compound-key relationship with unequal-length arrays is legal input, and zip() silently stops at the shorter array, dropping the extra key column(s) from the exported Sigma spec with no warning.

Steps to reproduce

from ossie import OssieDataset, OssieDocument, OssieRelationship, OssieSemanticModel
from ossie_sigma.ossie_to_sigma import OssieToSigmaConverter

document = OssieDocument(
    semantic_model=[
        OssieSemanticModel(
            name="m",
            datasets=[
                OssieDataset(name="orders", source="db.public.orders"),
                OssieDataset(name="regions", source="db.public.regions"),
            ],
            relationships=[
                OssieRelationship(
                    name="OrderRegion", **{"from": "orders"}, to="regions",
                    from_columns=["region_id", "sub_id"], to_columns=["region_id"],
                ),
            ],
        )
    ]
)
result = OssieToSigmaConverter().convert(document)
print(result.output["pages"][0]["elements"][0]["relationships"][0]["keys"])
print(result.issues)

keys comes out with a single region_id pair; sub_id is gone and issues is empty, so nothing about the loss is visible to the caller.

Environment

apache/ossie main @ fc6c9df (2026-09-15), converters/sigma.

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