Skip to content

Conversation

@nsmithuk
Copy link
Contributor

Summary

Slicing a SigmaCasedString currently returns a SigmaString. This PR preserves the concrete type so that SigmaCasedString remains SigmaCasedString after slicing, matching the behaviour of other SigmaString operations.

Motivation

Downstream code may rely on the specific string subtype. For example, in conversion/base.py L1677 we're explicitly working with SigmaCasedString, but a slice converts it to SigmaString. Subsequent functions (e.g. convert_value_str()) then lose the ability to detect the original type.

Behaviour

The current behaviour is:

type(SigmaCasedString("TestCasedString")[4:9]) is SigmaString

The new behaviour is:

type(SigmaCasedString("TestCasedString")[4:9]) is SigmaCasedString

Two simple tests have been added to cover this behaviour.

@thomaspatzke thomaspatzke merged commit f8c8e2d into SigmaHQ:main Sep 17, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants