Skip to content

[Bug][python] Incorrect processing of keyword parameters interrupts the data flow. #4842

Open
@scanleale

Description

@scanleale

Describe the bug
When I test a python function with a keyword argument, there is a break in the data flow

To Reproduce
py code like:

from typing import Optional
def func1(path: str):
    dataset_module = '123'
    dataset_name = path
    #get_dataset_builder_class(dataset_module, dataset_name)
    get_dataset_builder_class(dataset_module, dataset_name=dataset_name)
def get_dataset_builder_class(
    dataset_module: Optional[str], dataset_name: Optional[str] = None
):
    print(dataset_module)
    print(dataset_name)
    
func1("yooho")
def source = cpg.literal(".*yooho.*")
def sink = cpg.call("print")
sink.reachableByFlows(source).p

image

Expected behavior
While I use comment code which Non-Keyword Arguments get_dataset_builder_class(dataset_module, dataset_name), it looks like right.
image

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • WINDOWS11
  • Version: 4.0.34
  • openjdk 19

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions