Fix NaN serialization in Dataframe output; enable show_error
Browse files183 unmodified lines18418518618718818967 unmodified lines257258259260183 unmodified linesframe[c] = frame[c].round(1)csv_path = os.path.join(tempfile.gettempdir(), 'maastricht_parcels_filtered.csv')export.to_csv(csv_path, index=False)status = ('**' + format(len(res), ',d') + '** parcels match (of ' + format(len(df), ',d')+ ' in the snapshot). Garden ' + str(garden_rng[0]) + '\u2013' + str(garden_rng[1])+ ' m\u00b2, sorted by garden size; showing top ' + str(len(shown)) + '.')67 unmodified linesclose_btn.click(fn=lambda: ui.update(visible=False), inputs=None, outputs=modal)if __name__ == '__main__':demo.launch()183 unmodified lines18418518618718818919019119267 unmodified lines260261262263183 unmodified linesframe[c] = frame[c].round(1)csv_path = os.path.join(tempfile.gettempdir(), 'maastricht_parcels_filtered.csv')export.to_csv(csv_path, index=False)# NaN (parcels with no buildings have no bouwjaar) is not JSON compliant:# convert to None so the Dataframe payload serializes.shown = shown.astype(object).where(pd.notna(shown), None)status = ('**' + format(len(res), ',d') + '** parcels match (of ' + format(len(df), ',d')+ ' in the snapshot). Garden ' + str(garden_rng[0]) + '\u2013' + str(garden_rng[1])+ ' m\u00b2, sorted by garden size; showing top ' + str(len(shown)) + '.')67 unmodified linesclose_btn.click(fn=lambda: ui.update(visible=False), inputs=None, outputs=modal)if __name__ == '__main__':demo.launch(show_error=True)
_space/app.py+4-1