Closed
Description
VSCode's Python plugin can't understand the type of transport
argument for CloudLoggingHandler
's constructor. It expects to see BackgroundThreadTransport class instead of base.Transport.
So a call with SyncTransport is reported as an error:
import google.cloud.logging
from google.cloud.logging.handlers import CloudLoggingHandler, setup_logging
from google.cloud.logging.handlers.transports import SyncTransport
client = google.cloud.logging.Client()
handler = CloudLoggingHandler(client, name=LOGGER_NAME, transport=SyncTransport)
Argument of type "type[SyncTransport]" cannot be assigned to parameter "transport" of type "type[BackgroundThreadTransport]" in function "init"
"type[SyncTransport]" is incompatible with "type[BackgroundThreadTransport]"
