I have the below code, when i run it i get this error in my jupyter notetbook: TypeError: Object of type bytes is not JSON serializable.
import pyodbc
conn = pyodbc.connect('Driver={SQL Server Native Client 11.0};'
'Server=LDN01939344;'
'Database=EData;'
'Trusted_Connection=yes;'
)
sql = 'SELECT top 100 * from EData.dbo.DTData'
data = pd.read_sql(sql,conn)
app = dash.Dash(__name__)
app.layout = dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} for i in data.columns],
data=data.to_dict('records'),
style_header={
'backgroundColor': 'rgb(230, 230, 230)',
'fontWeight': 'bold'
}
)
if __name__ == '__main__':
app.run_server(debug=False,ssl_context='adhoc')
then i get that error- any idea what i can do???