We need to rely on pyodbc, the sample code is as belows.

import pyodbc
cnxn = pyodbc.connect('DRIVER={ODBC Driver 13 for SQL Server};SERVER=SQLSERVER2017;DATABASE=Adventureworks;Trusted_Connection=yes')

Write SQL and execute with pandas.read_sql

import pandas
query = "SELECT * from a"
df = pd.read_sql(query, sql_conn)