Skip to content

Commit

Permalink
Fix CI errors (#532)
Browse files Browse the repository at this point in the history
We hastly merged in the changes in the previous pull requests. This
patch fixes the CI errors.
  • Loading branch information
mristin authored Oct 27, 2024
1 parent dc2d21c commit 16c8ed1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 3 additions & 3 deletions aas_core_codegen/protobuf/common.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Provide common functions shared among different ProtoBuf code generation modules."""

import re
from typing import List, cast, Optional
from typing import List, cast

from icontract import ensure, require

from aas_core_codegen import intermediate
from aas_core_codegen.common import Stripped, assert_never
from aas_core_codegen.common import Stripped, assert_never, Identifier
from aas_core_codegen.protobuf import naming as proto_naming


Expand Down Expand Up @@ -147,7 +147,7 @@ def generate_type(type_annotation: intermediate.TypeAnnotationUnion) -> Stripped
# We have to add the suffix ``_choice`` since this field points
# to one of the concrete descendants of the class as well as
# the concrete class itself.
message_name += "_choice"
message_name = Identifier(message_name + "_choice")

return Stripped(message_name)

Expand Down
6 changes: 1 addition & 5 deletions aas_core_codegen/protobuf/structure/_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
Tuple,
cast,
Union,
Set,
)

from icontract import ensure, require

from aas_core_codegen import intermediate
from aas_core_codegen import specific_implementations
from aas_core_codegen.common import (
Error,
Identifier,
Expand Down Expand Up @@ -403,7 +401,7 @@ def _generate_choice_class(cls: intermediate.ClassUnion) -> Stripped:
# Protocol Buffers do not support inheritance, so we have to work around that
# circumstance.

message_name = proto_naming.class_name(cls.name) + "_choice"
message_name = Identifier(proto_naming.class_name(cls.name) + "_choice")

else:
assert_never(cls)
Expand Down Expand Up @@ -440,8 +438,6 @@ def generate(

errors = [] # type: List[Error]

required_choice_objects = set([]) # type: Set[intermediate.AbstractClass]

for our_type in symbol_table.our_types:
if not isinstance(
our_type,
Expand Down

0 comments on commit 16c8ed1

Please sign in to comment.