[Bug] Fix typo in downgrade_contents_from_rule (#3272)

* Fix missing to_dict()

* Update pyproject.toml
This commit is contained in:
Eric Forte
2023-11-14 23:06:04 -05:00
committed by GitHub
parent f53f46efd5
commit 66c1d7f3b4
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -1290,8 +1290,12 @@ def downgrade_contents_from_rule(rule: TOMLRule, target_version: str, replace_id
rule_dict = downgrade(rule_dict, target_version=str(min_stack_version))
meta = rule_dict.pop("meta")
rule_contents = TOMLRuleContents.from_dict({"rule": rule_dict, "metadata": meta,
"transform": rule.contents.transform})
rule_contents_dict = {"rule": rule_dict, "metadata": meta}
if rule.contents.transform:
rule_contents_dict["transform"] = rule.contents.transform.to_dict()
rule_contents = TOMLRuleContents.from_dict(rule_contents_dict)
payload = rule_contents.to_api_format()
payload = strip_non_public_fields(min_stack_version, payload)
return payload
+1 -1
View File
@@ -26,7 +26,7 @@ dependencies = [
"elasticsearch~=8.1",
"eql==0.9.19",
"jsl==0.2.4",
"jsonschema==3.2.0",
"jsonschema>=3.2.0",
"marko==2.0.1",
"marshmallow-dataclass[union]~=8.5.12",
"marshmallow-jsonschema~=0.12.0",