'Code Inspection Warning with pandas.read_csv read from string buffer

My Python environment uses Pandas 1.4.2. I have the following code that reads from a string buffer:

response: requests.Response = session.get(url="...")
data: pandas.DataFrame = pandas.read_csv(io.StringIO(response.content.decode("utf-8")), skiprows=2)

When I run Code Inspection in PyCharm, I get the following warning:

Expected type 'str | PathLike[str] | ReadCsvBuffer[bytes] | ReadCsvBuffer[str]', got 'StringIO' instead

What change should I make to my code to resolve the issue short of suppressing the warning?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source