python:S5655 being raised as a false positive

Apparently this was fixed by setting python to 3.9

For a dataclass type this is still a problem in 3.10

@dataclass
class IOConf:
    sb_source: str
    container: str

def get_servicebus_receiver(client: ServiceBusClient, stage_config: IOConf, dlq: bool = False) -> ServiceBusReceiver:
   ...


with ServiceBusClient.from_connection_string(stage.servicebus_conn_str) as client:
    receiver = get_servicebus_receiver(client, stage, dlq=True)

mod_stage = replace(stage)
mod_stage.batch_size = 500
mod_stage.max_wait = 5

with ServiceBusClient.from_connection_string(stage.servicebus_conn_str) as client:
    receiver = get_servicebus_receiver(client, mod_stage, dlq=True) # python:S5655

Hello @icfly2 and sorry for the late answer,

I assume in the example you provide, the issue is erroneously raised on the mod_stage argument?

Could you provide an updated version of the reproducer to show how stage is defined, as well as what is replace in this context?

Without this information, it would be difficult to investigate this further, as I cannot reproduce the issue.